Protocol
Routing
The base protocol for all routers.
@MainActor protocol Routing : AnyObject
Mentioned In
Overview
A router owns a slice of the napkin tree: it holds a reference to its Interactable and to the child routers attached beneath it, and it exposes the asynchronous lifecycle hooks the parent router uses to activate, load, and tear that subtree down.
Overview
Routing is @MainActor-isolated because routers manipulate the view tree and present view controllers. Lifecycle methods are async because they must await actor-isolated calls into the underlying Interactable.
The children array reflects the routers currently attached to this router. Mutation of the array goes exclusively through attachChild(_:) and detachChild(_:); both methods drive the child’s interactor activation/deactivation in the right order. Routers should not append to children directly.
See Also
Router
See Also
ViewableRouting
See Also
LaunchRouting
Topics
Accessing the Subtree
Lifecycle
Managing Children
Relationships
Conforming Types
Inherited By