UIViewController
extension UIViewController
                - 
                  
                  
Embeds a child
UIViewController.Declaration
Swift
public func embed(child newChild: UIViewController, in container: UIView? = nil)Parameters
newChildThe child
UIViewControllerto embed.containerThe container
UIViewto embed the child view controller’s view to. - 
                  
                  
Unembed as a child
UIViewControllerof a parentUIViewControllerif it exists.Declaration
Swift
public func unembed() - 
                  
                  
Unembeds all children
UIViewController.Declaration
Swift
public func unembedAllChildren() - 
                  
                  
Presents
UIViewControllerinto thenavigationControllerview stack or on theUIViewController.topMost()Declaration
Swift
public func showModally(in viewController: UIViewController? = nil, completion: (() -> Void)? = nil)Parameters
viewControllerThe
UIViewControllerwhere it will be presented intocompletionThe closure to be executed once the presentation is finished
 - 
                  
                  
Returns the top most view controller.
Declaration
Swift
public static func topMost(atRoot root: UIViewController? = UIApplication.shared.keyWindow?.rootViewController) -> UIViewController?Parameters
rootThe root
UIViewControllerto start traversing toward the top most view controller.Return Value
The top most
UIViewController. - 
                  
                  
Either dismisses or pops the view controller with a completion handler.
This method checks if the view controller is in a navigation stack and if it does, it pops the view controller from the stack. If the view controller is not in a navigation stack, this method tries to dismiss the view controller.
Declaration
Swift
public func close(animated: Bool, completion: (() -> Void)? = nil)Parameters
animatedSpecify true to animate the transition or false if you do not want the transition to be animated.
completionThe closure to execute after the transition finishes. This closure has no return value and takes no parameters. You may specify nil for this parameter.
 
View on GitHub
        UIViewController Extension Reference