What is UIPilot and how does it work?
mainUIPilot is a lightweight SwiftUI navigation wrapper (barely 200 lines of code) designed to provide a more intuitive routing experience inspired by Android, Flutter, and web-based routers.
Key characteristics:
- Not a replacement for SwiftUI navigation: It acts as a wrapper. Version 1.x uses
NavigationView, while Version 2.x (recommended) usesUINavigationControllerunderneath. This ensures standard features like titles, swipe gestures, and top bars are available by default. - Type-safe Routing: Navigation paths and parameters are checked at compile time, preventing runtime crashes caused by incorrect routing.
- Composable/Nested Navigation: You can nest
UIPilotinstances as many times as needed to achieve complex layouts, such as split-screen behavior.