ContainerViewController

public class ContainerViewController : UIViewController

This view controller is an implementation of a generic container

  • Declaration

    Swift

    override public func viewDidLoad()
  • Call this to add a new controller.

    Declaration

    Swift

    public func addController(controller: UIViewController, yOffset: CGFloat, isNew: Bool, callback: (() -> Void)? = nil)

    Parameters

    controller

    The new view controller to be shown.

    yOffset

    Offset from top of container

    isNew

    If this parameter is true, the view controller is cached such that its state is retained

    callback

    Handler to be called after displaying the new view controller

  • Call this to function to remove the currently displayed controller.

    Declaration

    Swift

    public func removeController(controller: UIViewController)

    Parameters

    controller

    The view controller to be removed.

  • Call this to function to remove the currently displayed controller as well as clear all cached controllers.

    Declaration

    Swift

    public func clearAllControllers()
  • Call this to add a new controller with animation (dissolve).

    Declaration

    Swift

    public func addControllerAnimated(controller: UIViewController, yOffset: CGFloat, isNew: Bool)

    Parameters

    controller

    The new view controller to be shown.

    yOffset

    Offset from top of container

    isNew

    If this parameter is true, the view controller is cached such that its state is retained

  • Call this to function to get the controller currently being displayed

    Declaration

    Swift

    public func activeController() -> UIViewController?
  • Call this to function to get a cached controller by class name. If not found, nil is returned

    Declaration

    Swift

    public func controllerOnStack(className: String) -> UIViewController?

    Parameters

    className

    The class of the cached controller