UIViewController
extension UIViewController
-
Automatically handles how to present the next view controller. If the next view controller is a UINavigationController then present it; otherwise if self has a UINavigationController then push the next controller; otherwise present the next view controller.
Declaration
Swift
public func presentAutomatically( _ viewControllerToPresent: UIViewController, animated: Bool = true, completion: (() -> Void)? = nil )Parameters
viewControllerToPresentthe next view controller to present.
animatedthis presentation has animation?
completionthe completion after presentation.
-
Automatically handles how to dismiss this view controller. If this view controller has a UINavigationController and its UINavigationController has more than 1 view controllers then pop this view controller; otherwise dismiss this view controller.
Declaration
Swift
public func dismissAutomatically(animated: Bool = true, completion: (() -> Void)? = nil)Parameters
animatedthis presentation has animation?
completionthe completion after dismission.
View on GitHub
Install in Dash
UIViewController Extension Reference