How to combine multiple property wrappers to update a SwiftUI View?

preview_player
Показать описание
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.

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:

------
Other videos in the channel:

-----
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:
- Video edited with LumaFusion
Рекомендации по теме
Комментарии
Автор

Awsom Your presentation really illustrates how to do propertyWrappers, including pitfalls. Thank you so much.

larschristiansen
Автор

Nice explanation! One usecase I could think of for "double property wrapers" would be combining userdefaults and published/state

FloWritesCode
join shbcf.ru