UIApplicationDelegate

protocol UIApplicationDelegate : NSObjectProtocol
  • Switches root view controller avoiding common problems of unintended animations.

    Declaration

    Swift

    public func setRootViewController(_ viewController: UIViewController, setWindow: ((UIWindow) -> Void)? = nil, completion: (() -> Void)? = nil)

    Parameters

    viewController

    The new view controller to swift to.

    setWindow

    If self.window is nil, this closure will be executed

    completion

    The completion block to execute when the transition is completed.