SwiftyStyleProtocol

public protocol SwiftyStyleProtocol: class

Conform to this protocol to define how a control should be styled given a key and a StyleSet

  • style(styleSet:) Default implementation

    Defines how a control should be styled with a given styleSet. Most standard iOS controls should be defined inside the Swifty Style framework so this will mostly be used for custom controls.

    Default Implementation

    Default implementation of SwiftyStyleProtocol for UILabel

    Declaration

    Swift

    func style(styleSet: StyleSet)
  • style(as:) Default implementation

    Defines how a style can be retrieved given a key. If control also conforms to SwiftyStyleSetRetrieverProtocol, then there is no need to implement style(as key: String)

    Default Implementation

    Default implementation for style(as key: String) when control also conforms to SwiftyStyleSetRetrieverProtocol. Uses given key to attempt to retrieve styleSet as defined by protocol. After styling with retrieved set, do any additional styling if control conforms to SwiftyAdditionalStyleProtocol

    Declaration

    Swift

    func style(as key: StyleKeyProtocol)
  • style() Extension method

    Wraps style(as key: String), conrol must conform to SwiftyStyleInfoProtocol in order to style using styleKey

    Declaration

    Swift

    public func style()