Hey everyone,
I’d like to share Navi, a small pure-Swift 6 package that makes working with NavigationStack cleaner and safer — without forcing any particular architecture on your app.
The problem it solves
NavigationStack is a big improvement over the old NavigationView days, but once you need:
- multi-step deep links
- reliable “pop to a specific screen”
- type-safe routes that don’t break when someone inserts a screen in the middle of a flow
…you often end up writing brittle path surgery (path.removeLast(3)) or adopting a heavy routing framework.
Navi sits in the sweet spot: a thin, typed layer on top of Apple’s native NavigationStack. No custom stack, no UIKit bridges, no architecture lock-in.
Key features
| Need | Native NavigationStack |
Navi |
|---|---|---|
| Type-safe routes | Easy to lose with NavigationPath |
Enum + macro, compile-time checked |
| Programmatic navigation | Pass bindings / mutate path manually | push(to:) / pop() |
| Deep linking | Manual path construction | deepLink(to:) |
| Pop to a specific screen | Manual path surgery | @OriginKey + pop(to:) |
Links
- GitHub: GitHub - SwiftMates/Navi: Lightweight type-safe SwiftUI NavigationStack helper. Macros for destinations & origins, deep linking, programmatic navigation. Pure Swift 6, iOS 16+, no architecture lock-in. · GitHub
- Swift Package Index: https://swiftpackageindex.com/SwiftMates/Navi
- Medium deep-dive: https://medium.com/@davidpallatx/swiftui-navigation-needs-less-not-more-e3928b091777
Would love any feedback — especially if you’ve tried other navigation helpers or have ideas for improvements.