nalexn / clean-architecture-swiftui

SwiftUI sample app using Clean Architecture. Examples of working with CoreData persistence, networking, dependency injection, unit testing, and more.
MIT License
5.57k stars 671 forks source link

Routing state consistency #35

Closed glebus closed 3 years ago

glebus commented 3 years ago

First of all I would like to say "Thank you" for this great example!

I have a question regarding routing state consistency - when app opens country details it setups injected.appState[\.routing.countriesList.countryDetails] = #countryId#, but when user clicks Back button, I think, we need to clean routing value. I found the function goBack(), but I don't see any callers.

Could you please clarify this?

nalexn commented 3 years ago

Hey @glebus

The navigation state in SwiftUI can be toggled explicitly by our code or implicitly from inside system SwiftUI views that consume Binding for navigation state. Check out this line of the CountriesList view. I've removed the goBack() function, it's a leftover after refactoring (thanks for pointing out at it).

nalexn commented 3 years ago

I'm closing this one if you don't have more questions