iOS 13 Swift Tutorial: Understand Swift UI, Property Wrapper & More (@State & @EnvironmentObject)

  Рет қаралды 18,555

Brian Advent

Brian Advent

Күн бұрын

Пікірлер: 40
@jorgesegundorojas6119
@jorgesegundorojas6119 4 жыл бұрын
Dude, this tutorial it's a treasure !
@daLuftie
@daLuftie 5 жыл бұрын
Just for information: BindableObject is changed to ObservableObject. ObjectBinding is now ObservedObject.
@dougbelli9866
@dougbelli9866 4 жыл бұрын
Also in UserDefault.swift I had to change var value to var wrappedValue. Great Tut, thanks!
@glebcherkashyn2357
@glebcherkashyn2357 5 жыл бұрын
so, now in iOS we have "native Rx" and "native flutter". Nice tutorial, thank you! =)
@mattmmilli8287
@mattmmilli8287 5 жыл бұрын
Mind blown around 22:00 🤯🤯 thank you for great example
@thomasengland1701
@thomasengland1701 5 жыл бұрын
This is great Brian. Can you share how you can use the environment object in multiple views. On a presentation view I’m not getting access to the environment object.
@w0mblemania
@w0mblemania 5 жыл бұрын
That's strange. If you set the environment object at the start of a view hierarchy, all descendants are supposed to have access to that object. Possible a bug?
@KhairilUshan
@KhairilUshan 5 жыл бұрын
Great. Thank you, Brian. Can you also please make videos to explain another Swift feature that backed the SwiftUI implementation? Like for example: Function builder, Opaque return type
@dimiutube
@dimiutube 5 жыл бұрын
Wow! That was a lot of information! Thanks for the great tutorial!!
@JunaidKhan-ny8tu
@JunaidKhan-ny8tu 5 жыл бұрын
nice and clean Explanantion
@АлексейПархоменко-х9ы
@АлексейПархоменко-х9ы 5 жыл бұрын
I have got this problem: Property wrapper type 'UserDefault' does not contain a non-static property named 'wrappedValue'. I have got the latest version of Xcode 11 beta 7. Could you please say we how to fix it?
@daniellehill5196
@daniellehill5196 5 жыл бұрын
I had this error too. Just replace 'var value' with 'var wrappedValue' :)
@w0mblemania
@w0mblemania 5 жыл бұрын
Good video, thanks Brian.
@danielwatson6529
@danielwatson6529 5 жыл бұрын
has anyone got a link for the swift evolution proposal? i had a look but im not really sure what is it is that i am looking fior
@krutomjer
@krutomjer 5 жыл бұрын
Niiiice, these tutorials are great. They are binding (wink, wink) all of the frameworks together, the SwiftUI, combine etc
@arinasawa2638
@arinasawa2638 5 жыл бұрын
How would you use frameworks like AV Foundation with Swift UI Only? I know this framework is new and you might not know, and it is annoying for people to ask you these kind of questions when this framework literally just came out, but I just hope this makes you explore swift UI more!
@w0mblemania
@w0mblemania 5 жыл бұрын
As to the specifics of AV Foundation, I don't know, but any UIView subclass can be used in SwiftUI (at least in theory) by using UIViewControllerRepresentable. This is a wrapper around your non-SwiftUI views, that SwiftUI can handle.
@arinasawa2638
@arinasawa2638 5 жыл бұрын
@@w0mblemania Yeah I get that, but I really want to know If it is possible just using SwiftUI and nothing else,
@w0mblemania
@w0mblemania 5 жыл бұрын
@@arinasawa2638 In that case, no. SwiftUI is extremely bare-bones (and extremely rough) at this point. Even the most common things aren't supported.
@patrickclaessens9418
@patrickclaessens9418 5 жыл бұрын
Thanks Brian
@kerk09
@kerk09 5 жыл бұрын
How to count the number of rows after filtered by favorite?
@BrianAdvent
@BrianAdvent 5 жыл бұрын
I would not count the rows but the elements in the array that are faved. You can do that with the result of the swift filter function.
@amit1922003
@amit1922003 5 жыл бұрын
Another amazing tutorial. Thank you so much🙏
@myevit
@myevit 5 жыл бұрын
@propertyWrapper struct UserDefault { let key: String let defaultValue:T var value:T { get{ return UserDefaults.standard.object(forKey: key) as? T ?? defaultValue } set{ UserDefaults.standard.set(newValue, forKey: key) } } } gives error: Property wrapper type 'UserDefault' does not contain a non-static property named 'wrappedValue'
@xxThemoritzxx
@xxThemoritzxx 5 жыл бұрын
Nice Tutorial, if i will Build a todo app, should i Store the Information inside the userdefaults or is the use of Core Data better?
@BrianAdvent
@BrianAdvent 5 жыл бұрын
The more complex your data structure and data model get the more you should think about using core data. Once you need relationships I would definitely use core data. If you just want to store some to do items User Defaults could do the job.
@w0mblemania
@w0mblemania 5 жыл бұрын
Also consider just saving your data to a json file, using Codable. It's a LOT easier than using CoreData for simple-to-medium sized data sets. Use CoreData as a last resort, IMO.
@RomanMedvid
@RomanMedvid 5 жыл бұрын
Wow, thanks man
@touchdani
@touchdani 5 жыл бұрын
Greaet Tutorial ;)!
@subscriber6181
@subscriber6181 5 жыл бұрын
Nice!
@asigivati1382
@asigivati1382 5 жыл бұрын
⭐️
@lukassbeataddicts
@lukassbeataddicts 5 жыл бұрын
Who else think they making Swift more difficult with every update. Swift 3 was comfortable for me but this getting harder and harder.
@BrianAdvent
@BrianAdvent 5 жыл бұрын
That’s an interest opinion. I can definitely understand if you are confused about the declarative style of SwiftUI but what changed between Swift 3 and 5 that you feel uncomfortable with?
@lukassbeataddicts
@lukassbeataddicts 5 жыл бұрын
@@BrianAdventMore closures and protocols, swift was meant to be easy to read and expressive. Actually I've watched some Apple videos and starting to like SwiftUI. Dragging from menu and Xcode automatically writes code is pretty cool.
@mukulbakshi28
@mukulbakshi28 5 жыл бұрын
Love from india 1
@vishrutvatsa
@vishrutvatsa 5 жыл бұрын
MUKUL BAKSHI Can you please stop commenting shit just because you want your comments to get a few likes?
@mukulbakshi28
@mukulbakshi28 5 жыл бұрын
Vishrut Vatsa so why u have problem. I dont ask u to judge. Grow up. I dont need ur approval to comment.
@DavidNitzscheBell
@DavidNitzscheBell 5 жыл бұрын
nope. That didn't make any sense.
@w0mblemania
@w0mblemania 5 жыл бұрын
You'll also need to watch the WWDC videos. They are required viewing at this point.
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Learn the Essentials of Swift in one hour
58:14
Paul Hudson
Рет қаралды 213 М.
24 Xcode Tips in 15 Minutes
15:30
Paul Hudson
Рет қаралды 74 М.
Transformers (how LLMs work) explained visually | DL5
27:14
3Blue1Brown
Рет қаралды 4,4 МЛН
SwiftUI - How to do Navigation in your Swift UI app
41:58
CodeWithChris
Рет қаралды 80 М.
SwiftUI Reactive Intro: State Management and Bindings
18:41
Lets Build That App
Рет қаралды 28 М.