PrismRouter
PrismRouter is an observable navigation manager that provides type-safe routing with push, sheet, and full-screen cover presentations. It bridges PrismArchitecture with SwiftUI’s navigation system.
Defining Routes
Routes must conform toPrismRoutable (which requires Hashable and Identifiable):
Route Definition
Creating a Router
Creating a Router
Navigation Operations
Push (Navigation Stack)
Push Navigation
Sheet Presentation
Sheet
Full-Screen Cover
Full Screen
Dismissing
Dismiss
Inspecting State
Router State
SwiftUI Integration
UsePrismNavigationView from PrismUI to connect the router to SwiftUI’s navigation:
PrismNavigationView
PrismNavigationView binds the router’s path to a NavigationStack, and presents sheets and full-screen covers automatically.
Using with PrismStore
Integrate routing into your architecture by including the router as state or passing it alongside the store:Router in Architecture
Deep Linking
Build a navigation path from a URL for deep linking:Deep Linking
Navigation Styles
PrismNavigationStyle defines the presentation style for a route: