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.
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?
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
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?
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.
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.
@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'
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!
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.
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?
@@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.
Dude, this tutorial it's a treasure !
Just for information:
BindableObject is changed to ObservableObject.
ObjectBinding is now ObservedObject.
Also in UserDefault.swift I had to change var value to var wrappedValue. Great Tut, thanks!
so, now in iOS we have "native Rx" and "native flutter". Nice tutorial, thank you! =)
Mind blown around 22:00 🤯🤯
thank you for great example
Wow! That was a lot of information! Thanks for the great tutorial!!
nice and clean Explanantion
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.
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?
Good video, thanks Brian.
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
Niiiice, these tutorials are great. They are binding (wink, wink) all of the frameworks together, the SwiftUI, combine etc
Another amazing tutorial. Thank you so much🙏
Thanks Brian
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?
I had this error too. Just replace 'var value' with 'var wrappedValue' :)
Wow, thanks man
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
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?
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.
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.
Nice!
Greaet Tutorial ;)!
@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'
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!
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.
@@w0mblemania Yeah I get that, but I really want to know If it is possible just using SwiftUI and nothing else,
@@arinasawa2638 In that case, no. SwiftUI is extremely bare-bones (and extremely rough) at this point. Even the most common things aren't supported.
How to count the number of rows after filtered by favorite?
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.
⭐️
Who else think they making Swift more difficult with every update. Swift 3 was comfortable for me but this getting harder and harder.
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?
@@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.
Love from india 1
MUKUL BAKSHI Can you please stop commenting shit just because you want your comments to get a few likes?
Vishrut Vatsa so why u have problem. I dont ask u to judge. Grow up. I dont need ur approval to comment.
nope. That didn't make any sense.
You'll also need to watch the WWDC videos. They are required viewing at this point.