Watch next: How to fix slow List updates in SwiftUI - kzbin.info/www/bejne/nmG2mJScjNyinpo Questions? Comments? Tweet me @twostraws.
@simonbachmann21205 жыл бұрын
IMPORTANT: ObjectBinding/BindableObject are deprecated now! @ObjectBinding is become @ObservedObject and BindableObject protocol is become ObservableObject as well as willChange become objectWillChange.
@niklasnickel5 жыл бұрын
Simon Bachmann Thank you so much! This indeed saved a lot of trouble...
@sreekumarmenon4 жыл бұрын
Was going to ask the same, I started swiftui recently and was confused with seeing ObjectBinding in this video! thanks
@MattiaRighetti4 жыл бұрын
I was going to ask when to use ObservableObject and BindableObject, thanks! 😊
@flexmcpee4 жыл бұрын
Ah that makes sense. Only started learning SwiftUI of late and was confused seeing those. Thanks for clearing up.
@ShalevLazarof4 жыл бұрын
thank you 👌
@abcd1239064 жыл бұрын
If you are learning SwiftUI, you literally NEEEEED to watch this video! This scratched so many cognitive "itches" I had about Swift, it's almost scary. Thank you, thank you, thank you!
@frimpongopokuagyemang80524 жыл бұрын
Saying that this video is "HELPFUL" would be an understatement. However, I have no bigger words. LOL! In short, THANK YOU DUDE! The way you make things clear, is just something else.👌👌👌👌👌
@kevin-u77193 жыл бұрын
I have saved 1 hour while watching you 20 minutes concrete and robust explanatory video. Thank you Paul.
@coolisfoolable3 жыл бұрын
This is THE best tutorial I've seen so far! And boy I've seen many. Thanks Paul!
@chrisual3 жыл бұрын
Much of this video is not appropriate anymore, but the description of what state, binding, etc are is TOTALLY worth watching. I have watched so many videos, but this is the first time I have understood these concepts. Well done Paul!!
@chezchezchezchez Жыл бұрын
I’m just getting started. What would you recommend is the perfect video right now for this information? Thank you very much.
@marlhex62802 жыл бұрын
Please make more! I love the way you talk with passion and interest! Also the way you edit the videos with a final touch! Awesome job!!!
@BroadcastYOzZelf4 жыл бұрын
I'm used .Net's, old Xaml's and to Qt Qml's (super elegant) property bindings. I was exactly looking for an intro on how SwiftUI does this. You found the perfect level between giving an overview and going into detail. Thanks!
@JVancity5 жыл бұрын
Been messing around with all three for a few days now, getting things to 'work'! This video really hit the nail on the head and now I truly understand the why. Thanks Paul, you're a legend :)
@MatthewCawley4 жыл бұрын
I've watched a few different videos on @State, @ObjectBinding and @EnvironmentObject and it didn't make that much sense. Your explanation was amazing, clear and high descriptive. Great job :)
@AndreaCiani4 жыл бұрын
This is the best video about this things I have ever watched. You make simple and more complicated examples and you describe them extremely well. Congrats and thanks!
@uberunix3 жыл бұрын
This is an absolutely fantastic explanation for someone like me who doesn't know enough yet to distinguish the significant bits of what the docs are saying. Thank you so much! :D
@brandonr.87842 жыл бұрын
Been stuck on these concepts for days, this video really help improve my understanding!
@nexplusedinburgh55455 жыл бұрын
Wow! Best SwiftUI video in the whole KZbin! Thank you!
@dhavalnena73865 жыл бұрын
Every time I watch your videos it gives me a deeper understanding of the topic explained. Thank you so much!
@rickstrickland24645 жыл бұрын
Your clarity is awesome. Can you do one that uses Core Data?
@alihodroj95595 жыл бұрын
maybe he already did one go check : )
@rickstrickland24645 жыл бұрын
Core Data with SwiftUI
@alihodroj95595 жыл бұрын
@@rickstrickland2464 oh now i get it : )
@brunofulber46885 жыл бұрын
I wasn't able to make it work too, got to figure a good way to make managed objects conform to bindableObject
@stephencollins28314 жыл бұрын
I’ve been an iOS dev for 1 week :) i think you can pull initial startup data out of core data in the scene delegate. Then pass that data into EnvironmentObjects so it can be accessible to all child view from main. Then each sub view can perform CRUD operations on it with core data. This method may not be great if you’re pulling a lot of data into memory. Perhaps there is a better way? Would love to hear!
@triXtyle Жыл бұрын
Amazing video, teaches us core concept in a very good way. BUT The Victor Hugo reference nailed it!!!
@JellyLancelot4 жыл бұрын
These videos are soooooo good. Your teaching style is amazing and easy to follow, but not slow enough that I'm skipping around for the info. Clear, concise and concentrated. Superb! Also, you explain the WHY. It's so important, but what so many people miss.
@ac124842 жыл бұрын
Best no bs intro (experienced programmer here)
@thomasanderson1416 Жыл бұрын
Can we refactor all the states out of view structs in a single file for example, and still access and control them from all views? That would be so awesome.
@koz5 жыл бұрын
Absolutely great stuff. You're making my Swift-learning experience a lot clearer. I'm intrigued about "who taught you?" though. Because I get the feeling you had a good teacher. (This is where you say you're self-taught too)
@farukenstein4 жыл бұрын
"please just stop and thnik for one moment how amazing that is" is the one possible definition when it comes to swiftui.
@rixantos Жыл бұрын
Great video @twostraws very well explained and delivered! Time to write some SwiftUI...
@JacksMacintosh5 жыл бұрын
Oh my goodness. This @EnvironmentObject thing might just save my life. Thank you thank you!
@Mriceman20025 жыл бұрын
You explain very easily even without the help of your two dogs :) You are the best ! Hope you continue to make many more videos!
@dlbYT83 жыл бұрын
Your content is gold. Thanks Paul!
@mistermagic45074 жыл бұрын
Finally my company decided to start the next project using SwiftUI on iOS 13 and here I am, BOOOM :)
@oliverbarreto18385 жыл бұрын
Great great tutorial... first division university class... core concepts really well explained and introduced vía telling an incremental story... a must watch... Apple should absolutely use this video and upload it to SwiftUI developer library 💪🏻😀😎
@ZoeSummers1701A Жыл бұрын
I think this is the best tutorial video you’ve ever made.
@robertsan26544 жыл бұрын
Being an iOS & React developer feels great with SwiftUI. :)
@Nicolas-is3gq4 жыл бұрын
Excellent tutorial, I finally understand these concepts after trying a few other sources. Thanks Paul!
@yixe22535 жыл бұрын
You're a great teacher, easy to understand.
@petersuvara5 жыл бұрын
Paul, we generally keep state as a completely different place to the UI components themselves, this provides a layer between state/transport and UI.
@numerics775 жыл бұрын
Xcode 11 beta 7, get errors at the 10:25 mark.. Cannot invoke initializer for type 'TextField' with an argument list of type '(Binding)'
@24Doggi4 жыл бұрын
Nest video for a guy who comes from java and python. Thanks!
@1sndct4 жыл бұрын
Great explanation, been trying to grasp this concept for a loooooong time, its finally coming together. Thank you
@Dan-t6h2s11 ай бұрын
Just learning Swift.. this was really helpful. And I caught your bread and 24601 reference… Cheers for that one!!! 🥃
@torcelly3 жыл бұрын
Hi Paul. Thank you for this awesome video. Excellent tutorial. Your explanation is accurate, concise, and clear. Congrats!
@idembele5 жыл бұрын
5:46 beautiful example on how @State keyword works
@wizzards445 жыл бұрын
Paul you are smashing it again!!! Great breakdown of new tools!!!
@shivammahendru61223 жыл бұрын
Much needed explanation!! Thanks Paul
@chettodust3 жыл бұрын
What do we do at 18:40 now that Scene Delegates are not produced in new default SwiftUi files?
@PeterPurmonen5 жыл бұрын
Excellent! All gaps flled. Thank you. 👍🏻
@thomasanderson1416 Жыл бұрын
Question please? After using ObjectBinding on the User class. How do we access it from different views with recreating a new instance?
@kronosDE5 жыл бұрын
The Textfield mentioned in the video doesn't work anymore. The new API is now something like that: TextField("placeholder text", text: $myInput)
3 жыл бұрын
13:40 Will it make an infinite loop as the first textfield changes reflects on third textfield and vice versa ??
@thealchemist14805 жыл бұрын
This is well described and very helpful video indeed. Keep the good work up,,, you are doing a commendable job for the community.
@michaelnajera79584 жыл бұрын
If multiple windows are created, say with a split screen on iPad showing two windows of your same app, will SceneDelgate pass the same reference of userData: User to both ContentView's? 18:45
@michaelrogers69355 жыл бұрын
Apple should've just let Paul see SwiftUI a week early and link all of their documentation to hackingwithswift.com. That would've saved a lot of developers a lot of time. What an awesome explanation!
@olepetersen44604 жыл бұрын
You make really great videos, and thank you for that. Regarding this one: My projects have no SceneDelegate, so an update would be highly appreciated. Where and how do you set up the global varible in the .app file?
@marcoespinoza33275 жыл бұрын
Stumbled upon your tutorials and explanations and it’s amazing. I am currently doing QA work and do some dev work too as I’m learning. However, this is preparing me for the future and I really appreciate your videos and explanations. I still want to transition from QA to dev because it’s more interesting but I know I have a while to go.
@thomasipad77193 жыл бұрын
Would a "@StateObject" be enought for the Class, without using Combine?
@littletalk88605 жыл бұрын
Great explanation, love your professional tutorial
@alisonsmith57495 жыл бұрын
Hi Paul, at ~15:15, you mention making sure to call passthroughsubject on the main thread. I searched all over and can't figure out how exactly to do that. Could you clarify via a code snippet on how to write that function on the main thread? Thanks!
@francescofuscaldo23645 жыл бұрын
Great videos, thank you so much. I'd like to suggest you a subject for the next videos, it would be great to see how to work with CoreData and SwiftUI!
@piyushgeorge18475 жыл бұрын
Best tutorial for the states. Loved it
@crewshin5 жыл бұрын
FYI: It looks like the BindableObject code is already broken with beta 4 :( I'm getting an error that "User" doesn't conform to protocol "BindableObject".
@A-Plays5 жыл бұрын
use ObservableObject instead and when u are creating a variable out of it use ObserevedObject for it.
@di_nerd_apps4 жыл бұрын
BEST EXPLANATIONS !! BIG UP!!!
@michaelrogers69355 жыл бұрын
Just one question: I can define var isAuthenticated = false, and then create a mutating method, toggleIsAuthenticated() to toggle it -- the compiler is happy with that. But, if I try and pass that into a Button, Button(action:{self.toggleIsAuthenticated()}, label:{Text("Toggle Me!")}), it is not happy -- and gives me the Cannot use mutating member on immutable value: 'self' is immutable error. Why is that?
@vipullal76894 жыл бұрын
Loved it! Clear tutorial.
@arkemal2 жыл бұрын
I've learned a lot from this. Thank you!
@AnkitRathi75 жыл бұрын
Everything clearly explained. Just one doubt, how can I use 2 user objects(like user1 and user2) from Environment?
@andrei-un3yr3 жыл бұрын
this is now quite confusing to me. I thought that what you use here as @ObjectBinding is what I thought to be @ObservedObject. What's the difference between them?
@tajapan4 жыл бұрын
All the didChange code can be replaced with @Published var username = "@twostraws"
@anata.one.19675 жыл бұрын
Here's a really interesting problem, how do you do object binding of type int/double with textfield??
@someonlinevideos5 жыл бұрын
Ananta Shahane wouldn’t you just use state?
@haraprasadsenapati66624 жыл бұрын
Awesome video Paul
@pitkaldewey10783 жыл бұрын
I was using a Class with OservedObject in a different View. But the text won´t update there. Anyone can help me and tell me how to update view programaticlly?
@alexanderfitterling3 жыл бұрын
Thank you so much for this video. You have amazing good teaching skills!
@guitaripod4 жыл бұрын
Now this now a year later, it's so clear. Thanks
@thomasanderson1416 Жыл бұрын
Why can’t you change properties in structs? They’re marked ‘var’ and not ‘let’. In all other languages you can change them all right.
@sreekanthiragam23055 жыл бұрын
I have a query on @state can not be used for reference types(viewmodel classes). I have seen some code examples where @ state is used for the model object in the view. I also read that @objectbinding might not update the view even if the model changes.
@andrevdw7474 жыл бұрын
What a clear explanation! Thanks! Also understandable for a beginner like me :-)
@MeteoraEra4 жыл бұрын
Your videos are awesome man.
@dimiutube4 жыл бұрын
Thanks for the great explanation, Paul! Now most of the magic behind SwiftUI is much clearer for me :-)
@niklasnickel5 жыл бұрын
Thank you very much! This was the first time I really understood what was going on...
@mattd54195 жыл бұрын
So what's @Binding used for?
@kimtipatel72 жыл бұрын
U r superb explaining ❤
@bnkohrn5 жыл бұрын
If an environment is basically a key-value store that uses the object's type as the key and the object as the value, then can you have only one object of a type in an environment?
@twostraws5 жыл бұрын
Not quite. It's actually key-value pairs, see: www.hackingwithswift.com/example-code/language/what-are-keyvaluepairs - that allows duplicates.
@limtc5 жыл бұрын
This is the best explanation so far! However, I do hope you can add in explanation of @Binding besides these 3.
@nicolinden5 жыл бұрын
Hi Paul, I like the @EnvironmentObject, but now you set userData as the environmentObject of the ContentView, can you also set more then one object on a view as a environment object though (like an array of objects)?
@max500k3 жыл бұрын
Awesome video, super concise!
@fortune11095 жыл бұрын
Hi Paul, thank you for the tutorials you are making. Helps me alot.
@puhgeh5 жыл бұрын
What's the difference of @Published and @State?
@JacksMacintosh5 жыл бұрын
Wait. If the environment works like a dictionary, and uses the object's type as the key, does that mean you can't have say, 2 User environment objects?
@ankitthakur855 жыл бұрын
These clarity is awesome. Could you please re-visit this again, once GM release happened for iOS 13. As the Combine framework is also in beta, and could have changes before GM release happens in September/October month.
@SehajChawla5 жыл бұрын
Love all your tutorials. Would be great to have in depth tutorials on Combine framework as well.
@raysubject Жыл бұрын
So you cannot pass multiple instances of same class into enviroment, because it uses class name as key, am i right ?
@dhavalnena73865 жыл бұрын
Question: can @EnvironementObject be replaced with Singleton class? as we can use it anywhere in the app wherever required similarly to what @EnvironmentObject does?
@tomtubbs62545 жыл бұрын
Thanks Paul - great visuals for the video along with your clear instruction. +1 for the request for a basic Swifty I app that uses core data.
@danielcrompton78188 ай бұрын
So what is @Environment vs @EnvironmentObject
@josephharrell67932 жыл бұрын
Can the json file be replaced with Core Data?
@sergehulne3 жыл бұрын
Excellent tutorial! Thanks!
@IsrafilGuseinov5 жыл бұрын
Use of undeclared type 'BindableObject' , what is that? Some bugs in swift? I can't do nothing,
@Seitenwerk5 жыл бұрын
because its deprecated. many things changed in the last month until the official release happened. you will have to teach for more recent tutorials for how its done in the release version oft combine
@IsrafilGuseinov5 жыл бұрын
Alexander Winkler thank u man
@A-Plays5 жыл бұрын
@@IsrafilGuseinov use ObservableObject instead of BindableObject and also when u are creating an object out of it use ObservedObject.
@IsrafilGuseinov5 жыл бұрын
ali pishvaee I already understood,thank you
@al-badyah53515 жыл бұрын
Can you explain to me when a notification was clicked, it must be redirected to desired page in IOS
@xcollector15905 жыл бұрын
Hi paul, does the way environmental object work similar to userdefault?
@gameover-je9ng5 жыл бұрын
Hi paul ... how can i create my own url JSON file , eg. etc ... ? need to have apple developer account ? i mean not free developer account . Help me plz i want to know , i searched on online but nothing found 😞
@doanvietios5 жыл бұрын
I love SwiftUI n I love this Tutorial too. This is awesome.
@TK-tg1hx3 жыл бұрын
You are really brilliant smart.... What a wonderful explain!? Thank you sooooo much!
@Goremachine2 жыл бұрын
What I don’t get is why a new user object needs to be instantiated in every view that needs to know about the state of the user - there is only one user in this case. Shouldn’t user be a single instance referenced by all the views?
@chezchezchezchez Жыл бұрын
Hello! Did you happen to find out? I’d like to know also, thank you!