🛠 UIKit's builder pattern.
let textLabel = UILabel.Builder()
.text("Hello, World!")
.textAlignment(.center)
.textColor(.black)
.font(.italic)
.build()
This is equivalent to
let label: UILabel = {
let label = UILabel()
label.text = "Hello, World!"
label.textAlignment = .center
label.textColor = .black
label.font = .italicSystemFont(ofSize: 17)
return label
}()
UIBuilderKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'UIBuilderKit'
jsryudev, [email protected]
UIBuilderKit is available under the MIT license. See the LICENSE file for more info.