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
stylingThe styling function that takes a
UIViewinstance
-
The styling function that takes a
UIViewinstance 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
stylesThe styles to compose.
Return Value
A new
UIViewStylethat will call the input styles’stylingmethod in succession. -
Compose this style with another styling function.
Declaration
Swift
public func composing(with otherStyling: @escaping (T) -> ()) -> UIViewStyle<T>Parameters
otherStylingThe function to compose this style with.
-
Apply this style to a UIView.
Declaration
Swift
public func apply(to view: T)Parameters
viewthe view to style
-
Apply this style to multiple views.
Declaration
Swift
public func apply(to views: T...)Parameters
viewsthe views to style
UIViewStyle Class Reference