InstantiatableContentView

public protocol InstantiatableContentView

Helps to instantiate content view from storyboard file.

Available where Self: NSObject

  • instantiateContentView() Default implementation

    Default Implementation

    Instantiates contentView from xib file and makes instantiator it’s owner. Xib filename should be composed of className + “ContentView” postfix. E.g. MyView -> MyViewContentView

    Declaration

    Swift

    func instantiateContentView() -> UIView

Available where Self: UIView

  • Instantiates contentView from xib file and makes instantiator it’s owner. Xib filename should be composed of className + “ContentView” postfix. E.g. MyView -> MyViewContentView After creation puts content view as subview to self and constraints sides. Also makes self background color transparent. The main idea here is that content view should fully set how self view looks.

    Declaration

    Swift

    @available(iOS 9.0, *)
    func instantiateAndAttachContentView()