Navigator
public protocol Navigator : AnyObject
                Represents a type which can navigate to a view controller.
- 
                  
                  
Navigate to a view controller.
Declaration
Swift
func navigate(to destinationViewController: UIViewController, modally isModal: Bool, animated: Bool, completion: (() -> Void)?)Parameters
destinationViewControllerThe view controller to navigate to.
isModalDetermines whether the navigation is modal or not.
animatedDetermines whether the navigation is animated or not.
completionThe closure to execute after the navigation finishes.
 
- 
                  
navigate(to:Default implementationmodally: animated: completion: ) Default Implementation
Navigate to a view controller.
In the case of a
UIViewControllerconforming to theNavigatorprotocol, a default implementation of thenavigate(to:,modally:,animated:,completion:)is provided. In this default implementation, theUIViewControllerconforming to theNavigatorprotocol calls the appropriate navigation method depending on whether the navigation is modal or not. If the navigation is modal, it presents the destination view controller by calling thepresent(_, animated:, completion:). Otherwise, if the navigation is not modal, the navigation controller of the view controller will push the destination view controller by callingpushViewController(_, animated:, completion:). If the navigation is not modal and there is no existing navigation controller, this does nothing.Declaration
Swift
public func navigate(to destinationViewController: UIViewController, modally isModal: Bool = false, animated: Bool = true, completion: (() -> Void)? = nil)Parameters
destinationViewControllerThe view controller to navigate to.
isModalDetermines whether the navigation is modal or not. This is
falseby default.animatedDetermines whether the navigation is animated or not. This is
trueby default.completionThe closure to execute after the navigation finishes. This is
nilby default. 
View on GitHub
        Navigator Protocol Reference