A Full Tour of NavigationStack , NavigationLink and navigationDestination - SwiftUI tutorial 2022

  Переглядів 20,816

Karin Prater

Karin Prater

День тому

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

КОМЕНТАРІ: 61
@zazoobah
@zazoobah Рік тому
So yeah, this kind of teaching style; showing a bunch of variations on the same theme without dragging the audience through a meaningless app building exercise - you hit the nail smack dab on the head. This is golden, more please ! Thanks for taking the time to study the new API and condense it down into a vid. Very nice Karin!
@roshanekka9687
@roshanekka9687 2 місяці тому
I also found it really helpful than those fast paced tutorials of building an app
@marcusziadev
@marcusziadev Рік тому
Damn, that last part. You've truly mastered that API
@stefanomontani6008
@stefanomontani6008 Місяць тому
Brilliant! Thank you for this great work.
@whansen101
@whansen101 8 місяців тому
THANK YOU ! This was so helpful. I am finally moving to SwiftUI from UI Kit and Navigation has really confused me until now : )
@FrostwareMx
@FrostwareMx 8 місяців тому
thank you so much!!! finally I understand it with navigationPath not even the documentation explain it !!!
@akashkumardas6521
@akashkumardas6521 5 місяців тому
I have challenged myself to learn swiftui in one day and this is the video. Just like a wow😮
@SiamakAshrafi
@SiamakAshrafi 9 місяців тому
Awesome descriptions. Thank You!
@HarrySchulting
@HarrySchulting Рік тому
Thank you for the Tutorial👍
@Ivanovich935
@Ivanovich935 Рік тому
Wow! Karin this was amazing! It was very detailed and you saved me A LOT of time! Thank you! ❤
@user-uc9er3hp2s
@user-uc9er3hp2s Рік тому
That was very helpful, thank you!
@officialspaceefrain
@officialspaceefrain Рік тому
Thank you! Amazing video. 🤗
@RatherBeCancelledThanHandled
@RatherBeCancelledThanHandled Рік тому
Extrodinairly well explained. Well Done !
@benhwang6378
@benhwang6378 Рік тому
Thank you! Help me a lot !
@nawafalmutairi2078
@nawafalmutairi2078 Рік тому
Best Swift channel! Thanks for making swift content!🙏
@SwiftyPlace
@SwiftyPlace Рік тому
I appreciate that!
@retro.spectral
@retro.spectral 11 місяців тому
Now this is a tutorial. Stellar.
@jethavayogesh2902
@jethavayogesh2902 8 місяців тому
Thank you 😊 Karin for the detail explanation.
@VogelCoage
@VogelCoage 5 місяців тому
Great video Karin, congrats and thanks a lot…
@Byte_Code
@Byte_Code Рік тому
Great tutorial. Thanks
@user-se1yi9cp5l
@user-se1yi9cp5l 9 місяців тому
Great explanation. Thank you.
@Wiintb
@Wiintb Рік тому
You do an amazing job. Brilliant. Thank you for your videos and tutorial.
@genebogdanovich972
@genebogdanovich972 Рік тому
I thought that adapting new navigation APIs in my app would be a pleasant walk in a park. It couldn't have been further from the truth. The app was crashing and hanging. Navigation links weren't working at all. This video definitely set me on the right path. Thank you so much!
@VogelCoage
@VogelCoage 8 місяців тому
Nice video Karin, u got a new subscriptor… go a head!!!
@tapiokuusisto4780
@tapiokuusisto4780 Рік тому
Really really useful and well-made. Thank you!
@SwiftyPlace
@SwiftyPlace Рік тому
Glad it was helpful!
@stodhair
@stodhair 10 місяців тому
You've just saved the UX of my application, thank you very much!
@kirillzverev299
@kirillzverev299 Рік тому
Thank you, I’ve spent 40 hours to get understandable for me info. And your describing is awesome and nice. ❤
@lincolndickerson1293
@lincolndickerson1293 Рік тому
Great coverage of this new way of doing things
@SwiftyPlace
@SwiftyPlace Рік тому
Glad you think so!
@user-cx1rm2ud2u
@user-cx1rm2ud2u 3 місяці тому
Karin, thank you for video! It helped me a lot! i can knew how can use destination without navigationLinks! 🤗
@georgehyker
@georgehyker 5 місяців тому
Great content! This video really helped us out. Well done, THANK YOU! I purchased your courses!!😀
@GeolseuDeiGamers
@GeolseuDeiGamers Рік тому
Great explanation!
@SwiftyPlace
@SwiftyPlace Рік тому
Very happy to hear!
@IcheVonB
@IcheVonB Рік тому
Thank you :)
@jorgesegundorojas6119
@jorgesegundorojas6119 Рік тому
You are the best ❤❤❤, this is my fav iOS channel by far !
@SwiftyPlace
@SwiftyPlace Рік тому
Wow, thanks!
@douglasrutledge1325
@douglasrutledge1325 Рік тому
I watch many NavigationStack videos; I still don't understand it. So hope you will make it clear. I'm excited to watch.
@AndrewDChristie
@AndrewDChristie 2 місяці тому
Thanks!
@joomjoo
@joomjoo Рік тому
Hi Karin Prater, amazing tutorial, actually even better than the apple kitchen one. Can you suggest a simple solution to change the default slide animation? Also to apply to the full stack or only the navlink?
@ivanoxg5079
@ivanoxg5079 Рік тому
cool...thanks.
@enshoremusic1494
@enshoremusic1494 Рік тому
Thank you very much Karin! This is by far the most comprehensive tutorial on NavigationStack if found till today! Did you also try out a TabView with each tab being a NavigationStack having its own path? I wonder what best practise would be in such a design?
@SwiftyPlace
@SwiftyPlace Рік тому
Not yet! But this should work because Apple recommends using NavigationStack inside TabView
@Decatilinae
@Decatilinae Рік тому
Thanks for sharing 😊… when you make a new course?
@balajiramadoss6014
@balajiramadoss6014 5 місяців тому
Hi Karin, Can you provide an example of LoginView -> (clears stack and push) HomeView ->(push) ListView ->(push) DetailView -> (clear stack and push) LoginView ?
@SOK-gn6hw
@SOK-gn6hw Рік тому
Hey, can you make a video about adding Images into our project like PhotosPicker?
@pierremarais7669
@pierremarais7669 Рік тому
Thanks Karin, I finally understand view stacking better, just one question, do you to create stacks per tabview or can you it on the highest level of your app? thanks Pierre
@Daniel-dw8lo
@Daniel-dw8lo Рік тому
Thanks for this. Are you able to add a background color behind the entire list? I’ve tried everything and it won’t work for me
@kenturnbull9679
@kenturnbull9679 6 місяців тому
Very good tutorial. Question about the ModelDataManager being put into the environment. Why didn't you add it to the app Entry @Main and all subsequent views are children/kinderen? Is there a problem with that approach? I tried it it and it works fine...maybe it will break somewhere; but not yet. Fingers crossed waiting for your reply.
@indiekiduk
@indiekiduk Рік тому
1:01:46 you're being polite ;-) I thought the way they did it was crazy!
@SwiftyPlace
@SwiftyPlace Рік тому
It always feel a bit strange to critic code from Apple engineers. But it really is too weird.
Рік тому
48:26 I burned myself with that lately. The environment object supplies ancestor views. But when you put it on the RootView and then push another view - this view is not part of the RootView, but NavigationStack. So in order to make it work properly, you would have to put it directly under NavigationStack. Screens will always be part of the NavigationStack or NavigationView. Other screens are just View siblings for RootView, not ancestors. Edit: Oh sorry, you figured this out later in the video.
@amirhosseinmatloubi5231
@amirhosseinmatloubi5231 Рік тому
i have question, can we use viewModels as enums associated type? for example second viewModel that is observable object and sotored in some other object like in stateObject viewModel. that might be second(viewModel:SecondViewModel). can we do that if we can is it right to do that?
@mtzgroup8010
@mtzgroup8010 Рік тому
Are you officially working in some company or you are a freelancer?
@cesmejia9014
@cesmejia9014 Рік тому
Have you managed to adapt this new navigation API with the Coordinator Pattern?
@douglasrutledge1325
@douglasrutledge1325 Рік тому
the meat of the video was good... but you really went down a rabbit hole!
@chr1s234
@chr1s234 9 місяців тому
you are so smart, can you marry me?
@unoarecare5728
@unoarecare5728 Рік тому
Finally 🎉
@yourgflikesit
@yourgflikesit Рік тому
How to do slide from bottom animation or fade animation?
@magpro8775
@magpro8775 Місяць тому
hello lady please how to create a pdf report , i mean full report with custom header ( company name, address, phone .. ect ) then report header ( invoice number, date, total, customer .. ect ) finally report rows(item, qty, total .. ect) thank you
How to use NavigationStack in SwiftUI | Bootcamp #62
23:59
Swiftful Thinking
Переглядів 27 тис.
Історія загиблого Назара Небожинського
00:54
Суспільне Рівне
Переглядів 995 тис.
Introduction to NavigationStack in iOS 16
22:52
Stewart Lynch
Переглядів 13 тис.
Enum Navigation in iOS 16
14:19
Stewart Lynch
Переглядів 10 тис.
NEW GPT-4o: My Mind is Blown.
6:28
Joshua Chang
Переглядів 12 тис.