Navigation in SwiftUI & iOS 16

  Рет қаралды 31,945

CodeWithChris

CodeWithChris

Күн бұрын

Get started with SwiftUI’s new navigation APIs for navigation stacks. You will learn about NavigationStack, NavigationPath and navigationDestination based on several examples.
Timestamps:
00:00 Introduction
00:43 Review: What was navigation like before iOS 16?
01:57 Example 1: NavigationStack + old NavigationLink
02:49 Example 2: NavigationStack + new NavigationLink + navigationDestination
05:44 Example 3: NavigationPath + programmatic navigation
09:03 Example 4: NavigationPath + multiple types
17:49 Outro
Links:
Code: www.dropbox.com/sh/rice97l5qc...
Xcode Beta: developer.apple.com/download/...
🚨 SPECIAL CWC+ OFFER FOR KZfaq:
cwc.to/youtubeoffer
🚨 SPECIAL CWC+ OFFER FOR KZfaq:
cwc.to/youtubeoffer
MY FREE ONLINE COURSE:
⚡ How to make an app in 14 days - cwc.to/14days
CWC+ PROGRAM:
👩‍💻 All our courses in a learning path - cwc.to/plus
WEEKLY UPDATES VIA EMAIL:
✉️ Every Saturday, receive an email digest of new content - cwc.to/newsletter
CONNECT:
🌍 Website - codewithchris.com
😺 GitHub - github.com/codewithchris
📸 Instagram - / codewithchris
🐦 Twitter - / codewithchris
ABOUT CODEWITHCHRIS:
Hi I’m Chris! I’m dedicated to teaching fundamentals about how to make an app. This is important if you’re trying to land an iOS job, be a freelancer, increase or start a business with an app idea. On this channel and my website, you'll find a ton of free resources and tutorials to aid you on your journey to learn iOS development. Many people have learned to code and build apps on their own! cwc.to/reviews
DID THESE LESSONS HELP YOU?
Please let me know! - feedback.codewithchris.com
ROADMAP:
roadmap.codewithchris.com
#iOS16 #Xcode14 #SwiftUINavigation

Пікірлер: 57
@FloWritesCode
@FloWritesCode 2 жыл бұрын
These changes are SO GOOD! Thanks for letting me host this lesson😁
@CodeWithChris
@CodeWithChris 2 жыл бұрын
Wunderbar! @AdrienVillez
@bigmtnstudio
@bigmtnstudio Жыл бұрын
Thanks for the mention, Flo. 🤗 Awesome overview!
@jamesallison9725
@jamesallison9725 Жыл бұрын
Wonderful!! This is the best Navigation Stack tutorial I have found so far. Thanks - I am subscribing right now.
@CodeWithChris
@CodeWithChris Жыл бұрын
Awesome, thank you! - Pat
@ninumedia
@ninumedia 2 ай бұрын
Excellent tutorial and really appreciate the thoughtful examples. I learned multiple things I didn't know already. You earned a new subscriber.
@markaurelius61
@markaurelius61 2 жыл бұрын
This is the first time I had seen NavigationPath, but I think that is what makes NavigationStack useful
@FloWritesCode
@FloWritesCode 2 жыл бұрын
For sure. This is what really enables programmatic navigation with little overhead. It's also doable without NavigationPath, but needs a bit more setup.
@EricTMCode
@EricTMCode Жыл бұрын
What a great Navigation Stack tutorial, thank you 🤩
@CodeWithChris
@CodeWithChris Жыл бұрын
Glad you liked it! - Pat
@ColeHowe-el5qg
@ColeHowe-el5qg Жыл бұрын
Thank you man :) Your videos have been *extremely* helpful for me!! :')
@CodeWithChris
@CodeWithChris Жыл бұрын
Happy to hear that! :) - Pat
@w0mblemania
@w0mblemania 2 жыл бұрын
This was very useful, thanks.
@CodeWithChris
@CodeWithChris 2 жыл бұрын
Glad it was! Thanks for watching! :) - Pat
@GorYeghoyan
@GorYeghoyan 2 жыл бұрын
Awesome, thx a lot!
@CodeWithChris
@CodeWithChris 2 жыл бұрын
Thank you for watching! - Pat
@umairkhan4982
@umairkhan4982 Жыл бұрын
Great explanation
@chrisstromberg6527
@chrisstromberg6527 Жыл бұрын
This is probably one of the better explanations on SwiftUI Navigation that I have seen. There are some other great online instructors for SwiftUI, but they all pretty much dropped the ball on explaining NavigationStack.
@CodeWithChris
@CodeWithChris Жыл бұрын
Thank you for the kind words! :) - Pat
@thomascole8216
@thomascole8216 Жыл бұрын
Very nice! Great job...
@CodeWithChris
@CodeWithChris Жыл бұрын
Thank you very much! - Pat
Жыл бұрын
Thanks! 🙌🏻
@CodeWithChris
@CodeWithChris Жыл бұрын
No problem! - Pat
@gondaimgano
@gondaimgano 2 жыл бұрын
I love UIKit Storyboards but this new Navigation for SwiftUI is a game changer.
@CodeWithChris
@CodeWithChris 2 жыл бұрын
It really is. Thanks for watching! - Pat
@gondaimgano
@gondaimgano 2 жыл бұрын
@@CodeWithChris thank you to you!
@ColeDano
@ColeDano 2 жыл бұрын
Oh this is huge, navigation was a buggy mess. Nicely shown @Flo writes Code.
@CodeWithChris
@CodeWithChris 2 жыл бұрын
Great!! I'll pass the message along! Flo has a bunch of videos on his own channel to by the way! (kzfaq.infovideos) @AdrienVillez
@japonska2009
@japonska2009 Жыл бұрын
so if i understand this correctly(as a beginer in SwiftUI), when i am in between the lines of navigationDestination, i can already make a new ContentView design with Z/V/H stacks and add Spacer and all of that stuff for all the data i got from 1 Navigation Link(here would be some API data i got from the web)? I hope this is understandable
@srome0711
@srome0711 Жыл бұрын
Great video
@CodeWithChris
@CodeWithChris Жыл бұрын
Glad you enjoyed it! - Pat
@enoch8835
@enoch8835 Жыл бұрын
THANK U
@CodeWithChris
@CodeWithChris Жыл бұрын
You're welcome! - Pat
@bigmtnstudio
@bigmtnstudio Жыл бұрын
Thanks!
@CodeWithChris
@CodeWithChris Жыл бұрын
No problem! - Pat
@CodeWithChris
@CodeWithChris Жыл бұрын
Thanks for the Tip @Mark! @AdrienVillez
@JasemAlqaseer
@JasemAlqaseer Жыл бұрын
Thanks for the great video. I have a question please. I was able to initialize a subview with a binding property with the previous navigationLink initializer. is it possible to do that with the new navigationDestination? thanks
@CodeWithChris
@CodeWithChris Жыл бұрын
Hi Jasem! You can post your question on our CodeCrew forum and have our team assist you. Just visit this link codecrew.codewithchris.com. - Pat
@APWatchdog
@APWatchdog 2 жыл бұрын
Very useful video. Can you elaborate on how NavigationLink would work inside a Grid or GridRaw. It seems to no work.
@FloWritesCode
@FloWritesCode 2 жыл бұрын
It works just fine in my little test app. What does your setup look like? NavigationStack(path: $path) { Grid { GridRow { Color.green } GridRow { NavigationLink("Test Link", value: Person.examples[0]) } } .navigationDestination(for: Person.self) { person in Text(person.name) .font(.headline) } } This example works just as expected for me in Xcode 14 Beta 3.
@CodeWithChris
@CodeWithChris 2 жыл бұрын
Hi there! Can you post your concern on our CodeCrew forum codecrew.codewithchris.com? We have our tech support staff that are ready to help you out! :) - Pat
@dugrut1325
@dugrut1325 Жыл бұрын
... clear as MUD!
@Conquerz-tj7iw
@Conquerz-tj7iw 10 ай бұрын
mud isn't clear
@andre.unsal.13
@andre.unsal.13 Жыл бұрын
I'm comprehending this for the most part, but how do I get this paradigm working with custom SwiftUI View types? I don't know how I can just enum my SwiftUI views or make them hashable. Each view uses different observedobjects, and my ios15 code works - not sure how to make it work on ios16. On the hunt right now.
@CodeWithChris
@CodeWithChris Жыл бұрын
Hi Andre! We suggest posting your question on our CodeCrew forum and have our tech support staff assist you. Just visit this link codecrew.codewithchris.com - Pat
@TheSpiralnotizblock
@TheSpiralnotizblock Жыл бұрын
Will the old NavigationLink in future also be deprecated? Sometimes its better than the new one.
@CodeWithChris
@CodeWithChris Жыл бұрын
NavigationView will still be in use for quite some time, especially for app projects that are still on iOS 15 and below, since NavigationStack is not backwards compatible. In reality, production apps, especially those that have an existing user base can't easily raise the minimum iOS version to the latest one upon release as it would hurt their user metrics. Raising the minimum iOS compatibility would mean dropping a percentage of the user base from using your app. - Pat
@nikitapatidar8907
@nikitapatidar8907 Жыл бұрын
What if I don't want to use list and how can pass data over multiple views.?
@CodeWithChris
@CodeWithChris Жыл бұрын
Hi Nikita! We suggest posting your question on our CodeCrew forum so that our tech support staff can help you. Just visit this link codecrew.codewithchris.com. - Pat
@SwiftUA
@SwiftUA Жыл бұрын
How use presentation Detents together with tabview?
@CodeWithChris
@CodeWithChris Жыл бұрын
We suggest posting your question on our CodeCrew forum codecrew.codewithchris.com. Our tech support staff will help you out! - Pat
@GoeHybrid
@GoeHybrid 2 жыл бұрын
Well, no backward compatibility, as always. "Thanks" apple. I swear to go, ios development is a joke.
@CodeWithChris
@CodeWithChris 2 жыл бұрын
SwiftUI is a very young language and we can expect a lot more changes in the future too. Indeed, things are going to be interested in September when all this goes live. @AdrienVillez
@w0mblemania
@w0mblemania 2 жыл бұрын
@@CodeWithChris The problem is that SwiftUI isn't very young any more... It was released in 2019, and we're up to SwiftUI 4. And with every release, there are show-stopping problems that force us to go back to UIKit. And everyone has to keep asking "is SwiftUI production-ready?". Apple need to dogfood SwiftUI... the vast majority of their apps aren't using SwiftUI yet they tell us that SwiftUI is the best way to make an app. SwiftUI feels like the future, but we have to work in the here and now.
@CodeWithChris
@CodeWithChris 2 жыл бұрын
Yes... well, I was comparing it to something like Java, C, or even Objective-C. But yes, working with iOS and SwiftUI is a non stop Learning-Coding-Learning-Coding-Change/Fix-Learning-Coding loop. I do understand your frustration. From my experience, Xcode does a pretty good job to suggest edits and new ways to write a line of code when converting an older project. Not sure if this will be the case. PS: This comment thread will slowly disappear in the abyss of youtube's older comments (well, at leas this is how they are given to use), so I would recommend you to join us in the Forum! codecrew.codewithchris.com/. Come and chat with us and talk SwiftUI with the team!) @AdrienVillez
@yourgflikesit
@yourgflikesit Жыл бұрын
How do we change the slide animation to a fade animation?
@CodeWithChris
@CodeWithChris Жыл бұрын
We suggest posting your question on our CodeCrew forum so that our tech support satff can assist you. Just visit this link codecrew.codewithchris.com - Pat
Data Flow in a SwiftUI App
33:15
CodeWithChris
Рет қаралды 53 М.
NavigationStack - SwiftUI Programmatic Navigation - iOS 16
20:20
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 9 МЛН
Little girl's dream of a giant teddy bear is about to come true #shorts
00:32
Пранк пошел не по плану…🥲
00:59
Саша Квашеная
Рет қаралды 6 МЛН
Introduction to NavigationStack in iOS 16
22:52
Stewart Lynch
Рет қаралды 14 М.
This NEW SwiftUI Feature Is AMAZING | Navigation Stacks
20:05
How to Build a Custom Tab Bar in SwiftUI
26:22
CodeWithChris
Рет қаралды 34 М.
Why You Should Use The SwiftUI Coordinator Pattern
18:45
Rebeloper - Rebel Developer
Рет қаралды 13 М.
SwiftData Basics in 15 minutes
15:18
CodeWithChris
Рет қаралды 41 М.
How to use NavigationStack in SwiftUI | Bootcamp #62
23:59
Swiftful Thinking
Рет қаралды 32 М.
What is an API and how does it work? (In plain English)
7:12
CodeWithChris
Рет қаралды 791 М.
SwiftUI List with Custom Cell & Passing Data
36:27
Sean Allen
Рет қаралды 115 М.
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 9 МЛН