ā† All articles

Graph-based routing for SwiftUI

Alright, hear me out. SwiftUI needs a router, using NavigationLink and .alert(isPresented:) with flags scattered in the view model layer is not scaling well. Helm integrates seamlessly with these native SwiftUI modifiers/entities, but also supports upfront navigation graph declaration (think about it like, defining which screen you can reach from which other screen upfront) and fully manages navigation state. In other words, once we have the navigation graph, everything else just works.

Also, it opens an interesting opportunity. Once we set up everything, automating the navigation between each screen is trivial. Snapshot testing or even recording promo materials can be done with minimal extra effort.

It's still beta, I'm only building my first app with it, but it has around 90% coverage and works great so far. Check it out!