nalexn / clean-architecture-swiftui

SwiftUI sample app using Clean Architecture. Examples of working with CoreData persistence, networking, dependency injection, unit testing, and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Routing state consistency

glebus opened this issue · comments

commented

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?

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).

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