ContextTask
public protocol ContextTask
The task to be applied after a UIViewController
was created or found.
NB
The ContextTask
will be applied to the new UIViewController
before it’s integration into the stack.
-
A
UIViewController
type associated with thisContextTask
Declaration
Swift
associatedtype ViewController : UIViewController
-
A Context type associated with this
ContextTask
Declaration
Swift
associatedtype Context
-
prepare(with:
Default implementation) -
The
Router
will call this method to run theContextTask
immediately afterUIViewController
been created or foundDeclaration
Swift
func perform(on viewController: ViewController, with context: Context) throws
-
execute(on:
Extension methodwith: ) Prepares the
ContextTask
and executes itDeclaration
Swift
func execute(on viewController: ViewController, with context: Context) throws
-
prepare()
Extension methodThe
Router
will call this method before the navigation process. If theContextTask
is not able to be applied to a view controller it should throw an exception.Declaration
Swift
mutating func prepare() throws
-
perform(on:
Extension method) The
Router
will call this method to run theContextTask
immediately afterUIViewController
been created or foundDeclaration
Swift
func perform(on viewController: ViewController) throws
Parameters
viewController
The
UIViewController
instance described in the step thatContextTask
attached to -
execute(on:
Extension method) Prepares the
ContextTask
and executes itDeclaration
Swift
func execute(on viewController: ViewController) throws
-
prepare()
Extension methodThe
Router
will call this method before the navigation process. If theContextTask
is not able to be applied to a view controller it should throw an exception.Declaration
Swift
mutating func prepare() throws
-
perform(on:
Extension method) The method that will be called by the
Router
to runContextTask
immediately afterUIViewController
been created or foundDeclaration
Swift
func perform(on viewController: ViewController) throws
Parameters
viewController
The
UIViewController
instance described in the step thatContextTask
attached to -
execute(on:
Extension method) Prepares the
ContextTask
and executes itDeclaration
Swift
func execute(on viewController: ViewController) throws