Customizable
public protocol Customizable
Describes a protocol to enable objects to be customized, typically chained at initialization time.
Inspired by: https://github.com/devxoul/Then
-
customize(_:)Extension methodSet properties on
selfwith a closure.Example:
let label = UILabel(frame: .zero).customize { $0.text = "Text goes here..." $0.textColor = .black $0.sizeToFit() $0.center = view.center $0.add(toSuperview: $0) }Declaration
Swift
@discardableResult public func customize(_ customize: (Self) -> Void) -> SelfParameters
customizeA closure, performing the customization.
Return Value
self
View on GitHub
Install in Dash
Customizable Protocol Reference