Deeplinking to last child in 3 level nested flow in 100% swiftUI project

This post was flagged by the community and is temporarily hidden.

Of course, like everyone, I'm still figuring out SwiftUI, but could you use state to drive things directly to level 3?

imagine level 1 is a view where the user selects a country, and level 2 is where the user selects a state/region. You could navigate to level 2 when selectedCountry != nil, and then route to level 3 when selectedRegion != nil. (using a navigationLink initializer with an isActive binding like this). Once this is set up, you could jump to level 3 by setting both selectedCountry and selectedRegion

Similarly, I think you could use isActive binding to tie the navigationLink to a coordinator. The coordinator could be a bindableObject or environment object that you bind isActive too.

Unfortunately I haven't done anything like this on my own, and I think they may depend on changes in beta 5 that I haven't had time to play with yet, so I'm sorry if I'm way off!

Terms of Service

Privacy Policy

Cookie Policy