ViewControllerModellableView

public protocol ViewControllerModellableView : AnyViewControllerModellableView, ModellableView where Self.VM : ViewModelWithState

Extends the ModellableView protocol to add some convenience variables that refers to the ViewController that owns the View. A special case of ModellableView representing the UIView that the ViewController is managing. It’s intended to be used only as the main View of a ViewController.

Overview

A ViewControllerModellableView is a ModellableView that a ViewController is managing directly. It differs from a ModellableView only for a couple of computed variables used as syntactic sugar to access navigation items on the navigation bar (if present). A ViewControllerModellableView has also access to the universalSafeAreaInsets. The ViewController that is managing this View is responsible to call ModellableView.setup() and ModellableView.style() during the setup phase of the ViewController so you don’t need to do that.

  • navigationBar Extension method

    Shortcut to the navigationBar, if present.

    Declaration

    Swift

    public var navigationBar: UINavigationBar? { get }
  • navigationItem Extension method

    Shortcut to the navigationItem, if present.

    Declaration

    Swift

    public var navigationItem: UINavigationItem? { get }
  • viewController Extension method

    Syntactic sugar to access the ViewController that is managing this View.

    Declaration

    Swift

    public var viewController: UIViewController? { get set }