StaticViewFactory

@MainActor
public protocol StaticViewFactory

A factory that creates optional contained UIViews should conform to this protocol.

  • A type of the view to build.

    Declaration

    Swift

    associatedtype View : UIView
  • Factory method that will be called by the corresponding container UIView

    Declaration

    Swift

    @MainActor
    static func buildView(within bounds: CGRect) -> View?

    Parameters

    bounds

    A bounds rect of the container.

    Return Value

    Build UIView instance.

Available where Self: UIView

  • buildView(within:) Default implementation

    Default Implementation

    Default extension build the UIView using its default constructor.

    Declaration

    Swift

    @MainActor
    static func buildView(within bounds: CGRect) -> Self?