ContextTask
@MainActor
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
UIViewControllertype associated with thisContextTaskDeclaration
Swift
associatedtype ViewController : UIViewController -
A Context type associated with this
ContextTaskDeclaration
Swift
associatedtype Context
-
prepare(with:Default implementation) -
The
Routerwill call this method to run theContextTaskimmediately afterUIViewControllerbeen created or foundDeclaration
Swift
@MainActor func perform(on viewController: ViewController, with context: Context) throws
-
execute(on:Extension methodwith: ) Prepares the
ContextTaskand executes itDeclaration
Swift
@MainActor func execute(on viewController: ViewController, with context: Context) throws
-
prepare()Extension methodThe
Routerwill call this method before the navigation process. If theContextTaskis not able to be applied to a view controller it should throw an exception.Declaration
Swift
@MainActor mutating func prepare() throws -
perform(on:Extension method) The
Routerwill call this method to run theContextTaskimmediately afterUIViewControllerbeen created or foundDeclaration
Swift
@MainActor func perform(on viewController: ViewController) throwsParameters
viewControllerThe
UIViewControllerinstance described in the step thatContextTaskattached to -
execute(on:Extension method) Prepares the
ContextTaskand executes itDeclaration
Swift
@MainActor func execute(on viewController: ViewController) throws
-
prepare()Extension methodThe
Routerwill call this method before the navigation process. If theContextTaskis not able to be applied to a view controller it should throw an exception.Declaration
Swift
@MainActor mutating func prepare() throws -
perform(on:Extension method) The method that will be called by the
Routerto runContextTaskimmediately afterUIViewControllerbeen created or foundDeclaration
Swift
@MainActor func perform(on viewController: ViewController) throwsParameters
viewControllerThe
UIViewControllerinstance described in the step thatContextTaskattached to -
execute(on:Extension method) Prepares the
ContextTaskand executes itDeclaration
Swift
@MainActor func execute(on viewController: ViewController) throws