AbstractFactory
@MainActor
public protocol AbstractFactory
Base protocol for all types of factories.
An instance that extends AbstractFactory builds a UIViewController that will later be
integrated into the stack by the Router
-
Type of
UIViewControllerthatAbstractFactorycan buildDeclaration
Swift
associatedtype ViewController : UIViewController -
Contextto be passed intoUIViewControllerDeclaration
Swift
associatedtype Context
-
The
Routerwill call it before the navigation process and if theAbstractFactoryis not able to build a view controller it should throw an exception. (example: it has to build a product view controller but there is no product code in context)Throws
TheRoutingErrorif theFactorycannot prepare to build aUIViewControllerinstance with theContextinstance provided.Declaration
Swift
@MainActor mutating func prepare(with context: Context) throws
-
prepare()Extension methodPrepares the
AbstractFactoryDeclaration
Swift
@MainActor mutating func prepare() throws
AbstractFactory Protocol Reference