UIViewStyle
open class UIViewStyle<T> where T : UIView
An abstraction if UIView
styling.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Initialization method
Declaration
Swift
public init(styling: @escaping (T) -> ())
Parameters
styling
The styling function that takes a
UIView
instance
-
The styling function that takes a
UIView
instance and performs side-effects on it.Declaration
Swift
public let styling: (T) -> ()
-
A factory method that composes multiple styles.
Declaration
Swift
public static func compose(_ styles: UIViewStyle<T>...) -> UIViewStyle<T>
Parameters
styles
The styles to compose.
Return Value
A new
UIViewStyle
that will call the input styles’styling
method in succession. -
Compose this style with another styling function.
Declaration
Swift
public func composing(with otherStyling: @escaping (T) -> ()) -> UIViewStyle<T>
Parameters
otherStyling
The function to compose this style with.
-
Apply this style to a UIView.
Declaration
Swift
public func apply(to view: T)
Parameters
view
the view to style
-
Apply this style to multiple views.
Declaration
Swift
public func apply(to views: T...)
Parameters
views
the views to style