Router
public protocol Router
Base router protocol.
-
Navigates the application to the view controller configured in
DestinationStep
with theContext
provided.Declaration
Swift
func navigate<ViewController: UIViewController, Context>(to step: DestinationStep<ViewController, Context>, with context: Context, animated: Bool, completion: ((_: RoutingResult) -> Void)?) throws
Parameters
step
DestinationStep
instance.context
Context
instance.animated
if true - the navigation should be animated where it is possible.
completion
completion block.
-
navigate(to:
Extension methodanimated: completion: ) Navigates the application to the view controller configured in
Destination
with theContext
provided.Declaration
Swift
func navigate(to destination: Destination<some UIViewController, some Any>, animated: Bool = true, completion: ((RoutingResult) -> Void)? = nil) throws
Parameters
destination
Destination
instance.animated
if true - the navigation should be animated where it is possible.
completion
completion block.
-
commitNavigation(to:
Extension methodanimated: completion: ) Navigates the application to the view controller configured in
Destination
with theContext
provided. Method does not throw errors, but propagates them to the completion block.Declaration
Swift
func commitNavigation(to destination: Destination<some UIViewController, some Any>, animated: Bool = true, completion: ((RoutingResult) -> Void)? = nil)
Parameters
destination
Destination
instance.animated
if true - the navigation should be animated where it is possible.
completion
completion block.
-
navigate(to:
Extension methodanimated: completion: ) Navigates the application to the view controller configured in
DestinationStep
with theContext
set toAny?
.Declaration
Swift
func navigate(to step: DestinationStep<some UIViewController, Any?>, animated: Bool, completion: ((_: RoutingResult) -> Void)?) throws
Parameters
step
DestinationStep
instance.animated
if true - the navigation should be animated where it is possible.
completion
completion block.
-
navigate(to:
Extension methodanimated: completion: ) Navigates the application to the view controller configured in
DestinationStep
with theContext
set toVoid
.Declaration
Swift
func navigate(to step: DestinationStep<some UIViewController, Void>, animated: Bool, completion: ((_: RoutingResult) -> Void)?) throws
Parameters
step
DestinationStep
instance.animated
if true - the navigation should be animated where it is possible.
completion
completion block.
-
commitNavigation(to:
Extension methodwith: animated: completion: ) Navigates the application to the view controller configured in
DestinationStep
with theContext
provided. Method does not throw errors, but propagates them to the completion blockDeclaration
Swift
func commitNavigation<Context>(to step: DestinationStep<some UIViewController, Context>, with context: Context, animated: Bool, completion: ((RoutingResult) -> Void)?)
Parameters
step
DestinationStep
instance.context
Context
instance.animated
if true - the navigation should be animated where it is possible.
completion
completion block.
-
commitNavigation(to:
Extension methodanimated: completion: ) Navigates the application to the view controller configured in
DestinationStep
with theContext
set toAny?
. Method does not throw errors, but propagates them to the completion blockDeclaration
Swift
func commitNavigation(to step: DestinationStep<some UIViewController, Any?>, animated: Bool, completion: ((RoutingResult) -> Void)?)
Parameters
step
DestinationStep
instance.animated
if true - the navigation should be animated where it is possible.
completion
completion block.
-
commitNavigation(to:
Extension methodanimated: completion: ) Navigates the application to the view controller configured in
DestinationStep
with theContext
set toVoid
. Method does not throw errors, but propagates them to the completion blockDeclaration
Swift
func commitNavigation(to step: DestinationStep<some UIViewController, Void>, animated: Bool, completion: ((RoutingResult) -> Void)?)
Parameters
step
DestinationStep
instance.animated
if true - the navigation should be animated where it is possible.
completion
completion block.