Переглядів 20,816
WWDC 2022 gave us a new Navigation API. In this SwiftUI tutorial I will show extended examples for NavigationStack. This works with the new value-based NavigationLink and navigationDestination. NavigationStack allows access to the NavigationPath, which you can use to implement programmatic navigation. It is much easier and cleaner to use than the deprecated NavigationView.
👉 read the corresponding blog post www.swiftyplace.com/blog/bett...
Additional resources:
WWDC The SwiftUI cookbook for navigation
developer.apple.com/videos/pl...
Overview
00:00 introduction
03:45 project set up
05:47 NavigationLink with value and navigationDestination
15:17 multilevel navigation stack
16:19 programmatic navigation with NavigationPath
21:46 custom back button
28:07 NavigationStack with custom type NavigationPath
35:04 complex navigation state
56:45 state restoration with @SceneStorage, Combine and Async Await
1:08:58 summary
If you liked what you learned and you want to see more, check out one of my courses!
👨💻 my SwiftUI course learn.swiftyplace.com/swiftui...
👨💻 my Core Data and SwiftUI course learn.swiftyplace.com/swiftui...
⬇️ Project files: github.com/gahntpo/Navigation...
#SwiftUI #Navigation #NavigationStack