carson-katri / router

Type-safe routing in SwiftUI
23 stars 0 forks source link

NavigationView integration #1

Open MaxDesiatov opened 4 years ago

MaxDesiatov commented 4 years ago

I'm not sure how this would work yet, but it would be great if the router either supported the native NavigationView and NavigationLink types or introduced new RoutableNavigation and RoutableLink (names to bikeshed) types that behaved in a similar way with support for NavigationView layout and transitions. Maybe it is supported already? I haven't had a chance to explore the source code yet, feel free to close this then.

carson-katri commented 4 years ago

Yeah that'd be nice. It would probably need to use the isActive binding on NavigationLink to activate the routes.

carson-katri commented 4 years ago

Ok, so I've got it somewhat working with 1a896c5.

That added a new routerLinkStyle modifier and RouterLinkStyle type. There are ButtonRouterLinkStyle, LinkButtonRouterLinkStyle, and NavigationLinkRouterLinkStyle.