Hello guys, welcome to another video!
There is more about property wrappers, today we will see if it's possible to use two or more wrappers at the same time, what about projected values, and finally how to update views in SwiftUI by using DynamicProperty protocol.
In the previous video, we talked about the basics of a property wrapper and wrappedValue, I recommend you to watch it first: [ Ссылка ]
Let's get started! 😄
Content:
0:00 - Intro
0:53 - A preview of the final solution
1:17 - The Problem
1:41 - Setting up wrappedValue
3:39 - Setting up the format parameter
6:07 - Can we combine two property wrappers?
9:36 - Using @State inside a property wrapper
10:37 - Setting up a projectedValue
14:08 - Using nonmutating in wrappedValue
15:54 - Conforming DynamicProperty
18:10 - Running the final version
19:17 - Outro
------
References:
* propertyWrapper attribute: [ Ссылка ]
* Projecting a value: [ Ссылка ]
* DynamicProperty: [ Ссылка ]
* nonmutating: [ Ссылка ]
Nesting property wrappers in Swift (by Noah Gilmore): [ Ссылка ]
Source code showed in the video: [ Ссылка ]
------
Other videos in the channel:
* State management in SwiftUI: [ Ссылка ]
* UIKit in SwiftUI: [ Ссылка ]
* Generics: [ Ссылка ]
* The power of Combine: [ Ссылка ]
-----
Don't forget to subscribe to the channel, like it, and follow me on social media:
Twitter:
[ Ссылка ]
[ Ссылка ]
Finally, ask me for a video you would like to see next 😄!
Credits:
- Music by Wataboi from [ Ссылка ]
- Video edited with LumaFusion
Ещё видео!