ControllerManager

public class ControllerManager

ControllerManager is a way to manage view controllers and invoke view controllers from a URL or class name.

  • Singleton instance of ControllerManager

    Declaration

    Swift

    public static let sharedInstance = ControllerManager()
  • Registers a url for calling handler blocks.

    Declaration

    Swift

    public func register<C: UIViewController where C: IntentReceivable>(url url: NSURL, clazz: C.Type)

    Parameters

    url

    The url to be registered.

    clazz

    The clazz to be registered, and the clazz’s view controller object will be launched while routed.

  • Launch a view controller from source view controller with a intent.

    Declaration

    Swift

    public func startController(source source: UIViewController, intent: Intent)

    Parameters

    source

    The source view controller.

    intent

    The intent for launch a new view controller.

  • Launch a view controller for which you would like a result when it finished. When this view controller exits, your onControllerResult() method will be called with the given requestCode.

    Declaration

    Swift

    public func startControllerForResult<C: UIViewController where C: IntentForResultSendable>(source source: C, intent: Intent, requestCode: Int)

    Parameters

    source

    The source view controller.

    intent

    The intent for start new view controller.

    requestCode

    this code will be returned in onControllerResult() when the view controller exits.