ConfigurableLayout

public protocol ConfigurableLayout: Layout

Convenient optional protocol for layout implementations to use instead of Layout.

It requires a more typesafe configure(view:) method that is used to implement configure(baseViewType:) in the Layout protocol.

  • Configures the given view.

    When implementing this method, use the specific concrete type for ConfigurableView.

    Example:

    class LabelLayout {
        func configure(view label: UILabel) {
            label.text = "example"
        }
    }
    

    MUST be run on the main thread.

    Declaration

    Swift

    func configure(view: ConfigurableView)
  • The class of view that should be created for this layout, if it needs a view. This is specified by the conforming class via its implementation of configure(view:).

    Declaration

    Swift

    associatedtype ConfigurableView: View