This is how you use Builder to customize any object:
Builder(subject: UIView())
.frame(CGRect(x: 0, y: 0, width: 100, height: 100))
.backgroundColor(.blue)
.build()
And these is how you can use it to create new instances of objects that conform to Initiable
protocol:
extension UIView: Initiable {}
UIButton()
.builder
.frame(CGRect(x: 0, y: 0, width: 100, height: 100))
.isSelected(true)
.build()
UIView
.builder
.backgroundColor(.white)
.alpha(0.5)
.build()
Builder(UITextField.self)
.placeholder("Type here")
.build()
let _: UILabel = Builder()
.text("text")
.build()
let _: UIImageView = Builder
.tintColor(.black)
.contentMode(.scaleAspectFit)
.build()
FluentBuilder is released under the MIT license. See LICENSE file for details.