NavigationStack | This is how SwiftUI's navigation should've been since day one!

  Рет қаралды 23,908

Swift and Tips

Swift and Tips

Күн бұрын

Пікірлер: 46
@RatherBeCancelledThanHandled
@RatherBeCancelledThanHandled Жыл бұрын
I thumbed this up because the image with the banana and the wacky sound was uhhhmazin
@ColeDano
@ColeDano 2 жыл бұрын
Thanks Pete! This is what I’ve been wondering since I started learning Swift. Layouts are so simple, yet any navigation beyond the most becomes a convoluted mess. This is big enough that the backwards compatibility starts to matter to me as well. Being an Indy, I might just adopt this anyway as navigation is critical to what I’m cooking up.
@officialspaceefrain
@officialspaceefrain 2 жыл бұрын
Tomato is a fruit 🥸. Great video btw. Love the edits. Keep it up !
@swiftandtips
@swiftandtips 2 жыл бұрын
CHANGE MY MIND 🍅! Just kidding, thanks for clarifying 😂! And thanks for your support 😊
@rgenericson5361
@rgenericson5361 Жыл бұрын
Congrats for presenting by far, the best explanation on KZbin!
@swiftandtips
@swiftandtips Жыл бұрын
Thank you so much 🙏🥰
@jujdu
@jujdu 2 жыл бұрын
Can't even imagine when we will be using this approach... Now we have iOS 14 in our project and I think we will have using it for the next 2-3 years (or even more) before we change it to only iOS 15, even not iOS 16. Because iOS 14 with SwiftUI it's kinda iOS 10-11 with UIKit some years ago. Apple's interfaces are pretty nice, but it's stupid that we can't use it for so long time. And more, even we can use it, it's anyway super high level API and we still can't do all stuff we need.
@swiftandtips
@swiftandtips 2 жыл бұрын
I know 😥, but I think the community will get inspiration of this approach to build a custom version in the meantime.
@LQ_LQ_LQ
@LQ_LQ_LQ 2 жыл бұрын
Godsend! Finally!
@anasalhalabi1051
@anasalhalabi1051 2 жыл бұрын
you are amazing Please continue
@swiftandtips
@swiftandtips 2 жыл бұрын
Thank you very much! 🙏
@aqibos
@aqibos Жыл бұрын
How do you get a reference to the NavigationPath in another view, say a child view that was appended already?
@swiftandtips
@swiftandtips Жыл бұрын
What would you like to do with that?
@aqibos
@aqibos Жыл бұрын
@@swiftandtips append to the navigation path in the child view. I ended figuring it out by adding it as an environment object.
@swiftandtips
@swiftandtips Жыл бұрын
@@aqibos Cool, can you share the code with us? Just to have a better context of what you did. Thanks!
@Ogrutsov
@Ogrutsov Жыл бұрын
Thanks for your video! How to make swipe back gesture if you hide or make custom navigation back button? Should I write custom gesture for that?
@swiftandtips
@swiftandtips Жыл бұрын
Great question, Yes! You will have to do your own implementation 😅
@fakingitpod
@fakingitpod 10 ай бұрын
love it
@FeminDharamshi
@FeminDharamshi 2 жыл бұрын
What do you use to make your videos? The slides/presentation?
@swiftandtips
@swiftandtips 2 жыл бұрын
Microsoft Paint, jk, I use Keynote :D!
@FeminDharamshi
@FeminDharamshi 2 жыл бұрын
@@swiftandtips Hahaha thanks!
@Mahadev-x7u
@Mahadev-x7u 2 жыл бұрын
Thank you…
@andrewduncanpoole
@andrewduncanpoole 2 жыл бұрын
Thank you fro these insights - it is definitely a good thing that Apple are improving the code making it more efficient and to the point. Is Navigationstack backward compatible for earlier versions of MacOS? The code won't run while on MacOS12.5 even with #if available(MacOS 13*)....
@swiftandtips
@swiftandtips 2 жыл бұрын
Hi Andrew, I’m sorry but it’s not backward compatible (yet). You can only use it on iOS16 and macOS Ventura and above. I hope this could be available for older OSs, but I don’t think they will do it. There isn’t backward compatibility for @StateObject on iOS 13, which is even more important than this.
@andrewduncanpoole
@andrewduncanpoole 2 жыл бұрын
@@swiftandtips Thank you for getting back to me. I will only really be able to implement this in October when Ventura is released - so will have to hold onto the existing convoluted code till then.
@dewigesrek5651
@dewigesrek5651 2 жыл бұрын
this os why i still stick my fingers in uikit. it’s mature and stable enough. look at this, ios 15+ only. imagine having to do if #available and put separate logic for 2 different ios version
@dewigesrek5651
@dewigesrek5651 2 жыл бұрын
apple could’ve made it available for ios 13+ but no
@swiftandtips
@swiftandtips 2 жыл бұрын
I agree with you, this would be better for iOS 13+, but at the same time, building a Framework that basically all the ecosystem can use is hard. I mean, I guess they may evaluate backward compatibility to see the impact on legacy OSs, but who knows 🤷🏻‍♂️
@fakingitpod
@fakingitpod 10 ай бұрын
wow
@dugrut1325
@dugrut1325 Жыл бұрын
... I'm still wondering! ???
@swiftandtips
@swiftandtips Жыл бұрын
🤔
@marlhex6280
@marlhex6280 Жыл бұрын
where's the best quality source to learn real SwiftUI data handling?
@swiftandtips
@swiftandtips Жыл бұрын
Hi @marlhex6280, What do you mean by real data handling?
@marlhex6280
@marlhex6280 Жыл бұрын
@@swiftandtips, thanks for the question. I mean passing views around 1 navigationStack, business logic architecture, and I think URLSession or Alamofire is now like old school as UIKit, Highly functional, but new companies will want async-await. I know SwiftUI needs to mature a little bit for us to catch up so they stop deprecating important stuff as NavigationView to NavigationStacks, and one final question, styling, I was implementing a picker on .segmented and trying to find a way to add colours to each segment it's just a little bit difficult to find at first glance if I add the modifiers in each bracket looks like it ignores the code, like when we apply cornerRadius it needs a specific order
@marlhex6280
@marlhex6280 Жыл бұрын
@@swiftandtips I've found this video from a friend that works at Meta kzbin.info/www/bejne/aaGsiYCtq69_kNU&ab_channel=AppStuff
@johncitrowske9922
@johncitrowske9922 Жыл бұрын
The sfx are very loud lol
@swiftandtips
@swiftandtips Жыл бұрын
I fixed that in later episodes 😅
@indiekiduk
@indiekiduk 2 жыл бұрын
It's great they are trying but this attempt is totally useless since a navigation value can't be a binding.
@swiftandtips
@swiftandtips 2 жыл бұрын
Hi @indiekiduk, Can you elaborate this?
@indiekiduk
@indiekiduk 2 жыл бұрын
NavigationLink(value: $fruit) navigationDestination(for: Binding.self) Instance method 'navigationDestination(for:destination:)' requires that 'Binding' conform to 'Hashable'
@oliver_lauritsen_oa
@oliver_lauritsen_oa 2 жыл бұрын
New navigation method sounds good but apple is just trash nothing is backwards compatible and it means if you want to make use of the new version you must update to newest iOS and swift it’s not like on android where most things is backwards compatible down to android 5 a nearly 10 year old version 😡
@swiftandtips
@swiftandtips 2 жыл бұрын
Yeah, that’s a bummer 🙁
@Patrick462
@Patrick462 2 жыл бұрын
Lack of backwards compatibility is a feature, not a bug.
@oliver_lauritsen_oa
@oliver_lauritsen_oa 2 жыл бұрын
@@Patrick462 WTF
@CrisCozy
@CrisCozy Жыл бұрын
Way less code 🎉
NavigationStack - SwiftUI Programmatic Navigation - iOS 16
20:20
How to use NavigationStack in SwiftUI | Bootcamp #62
23:59
Swiftful Thinking
Рет қаралды 37 М.
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 7 МЛН
These Swift 6 Features Change a Lot! | @SwiftBird
17:10
The Swift Bird
Рет қаралды 4,4 М.
This NEW SwiftUI Feature Is AMAZING | Navigation Stacks
20:05
Avoid THIS Animation Glitch When Hiding TabBar in SwiftUI
11:03
Swift and Tips
Рет қаралды 929
Introduction to NavigationStack in iOS 16
22:52
Stewart Lynch
Рет қаралды 15 М.
Enum Navigation in iOS 16
14:19
Stewart Lynch
Рет қаралды 11 М.
Why You Should Use The SwiftUI Coordinator Pattern
18:45
Rebeloper - Rebel Developer
Рет қаралды 16 М.
How to use SwiftfulRouting in SwiftUI | Swift Packages #5
32:00
Swiftful Thinking
Рет қаралды 7 М.
Navigation in SwiftUI & iOS 16
18:12
CodeWithChris
Рет қаралды 32 М.
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 7 МЛН