UIToolBox
The missing UIKit Toolbox. Easy to use extensions for UI, Layout and Animation.
Install / Use
/learn @buba447/UIToolBoxREADME
UIToolBox
UIToolBox is a set of tools, extensions, and classes for developing UI for iOS in Swift. Many of the extensions are Missing Features and easy to use helpers for creating readable code.
The library breaks down into three major parts:
- Auto Layout Extensions: Easy to use extensions for creating and animating constraints.
- Foundation Extensions: Missing functions and helpers for many Foundation objects. (EG Add, Subtract, Multiply two CGPoints! Get a UIColor's complement)
- UI Extensions: Clean and easy helper functions for several common UI functions.
See documentation below for full list of functions.
Installation
UIToolBox is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'UIToolBox'
Example

Say we want to create a view that animates its position and size using AutoLayout:
import UIKit
import UIToolBox
let view = UIView()
/// Create a color with Hue Saturation and Brightness
let color = UIColor(hue: 0.5, saturation: 1, brightness: 1, alpha: 1)
/// Set the view background color to be a dark complementary color.
view.backgroundColor = color.complementary.withBrightness(brightness: 0.2)
/// Create a view with the color
let colorView = UIView(backgroundColor: color)
colorView.cornerRadius = 12
view.addSubview(colorView)
/// Make a constraint group that pins the colorView to the top, leading and traling, with a height of 50
let topConstraint = ConstraintGroup(constraints: [
colorView.alignTopToView(view),
colorView.constrainHeight(50),
colorView.alignLeadingToView(view),
colorView.alignTrailingToView(view)
])
/// Make a constraint group that pins the colorView to the bottom, leading and trailing with a padding of 20, and a height of 72
let bottomConstraint = ConstraintGroup(constraints: [
colorView.alignBottomToView(view, constant: 30),
colorView.constrainHeight(72),
colorView.alignLeadingToView(view, constant: 20),
colorView.alignTrailingToView(view, constant: 20)
])
/// Set the top constraint to enabled, the bottom to disabled.
topConstraint.enable()
bottomConstraint.disable()
view.layoutIfNeeded()
/// Now lets animate from one constraint group to another with a spring animation.
topConstraint.disable()
bottomConstraint.enable()
view.animateLayoutChanges(
style: .slowSpring,
withAnimation: {
/// Animate the background color to its complementary.
colorView.backgroundColor = color.complementary
}) { (complete) in
/// Animation complete!
}
Documentation
Read the full documentation here
Author
Brandon Withrow, brandon@withrow.io
License
UIToolBox is available under the MIT license. See the LICENSE file for more info.
Related Skills
node-connect
347.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
