Member-only story
Featured
SwiftUI: Eliminating Navigation Registrations
How to dispense with navigationDestination(for:)… forever.
In earlier articles regarding my open source project Navigator, I’ve illustrated how NavigationDestination types simplify view navigation and presentation, and how they work with the rest of Navigator to support many advanced deep-linking and routing techniques.
And now, when used correctly, NavigationDestinations can also eliminate the need to do navigationDestination(for: MyType.self) registrations in your code.
Forever.
Let’s find out how.
Note that while this article discusses Navigator, the techniques demonstrated can be applied to any application.
About NavigationDestination
I wrote an entire article on Advanced Navigation Destinations, but so the rest of the following code makes sense I’ll just quickly reiterate the high points. You can come back and read the article later, if you wish.
A NavigationDestination is an enumerated type that allows you to define a simple value one can use with NavigationLink(value:label:), or when presenting sheets and fullScreenCover views.

