Skip to content

It's a proposal on how to pop to root using SwiftUI native tools

License

Notifications You must be signed in to change notification settings

ihor-yarovyi/SwiftUI-Route-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftUI-Route-Manager

It's a proposal on how to pop to root using SwiftUI native tools. This solution works well when the root view is a start point for two or more flows and at some point of these flows the user has the ability to do the pop to root.

More information you cane find here

!! IMPORTANT !!

You should use the unselect method of the RouteManager when the user goes forward to the flow and then goes back by tapping on the back button. In this case, need to reset the state of our route manager for the previously selected flows to avoid undefined (unexpected) behavior:

.onAppear {
    routeManager.unselect(.signUp)
    routeManager.unselect(.restorePassword)
}

Demo

About

It's a proposal on how to pop to root using SwiftUI native tools

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages