How to create custom Property Wrappers in SwiftUI (PART 1/2) | Advanced Learning #30

preview_player
Показать описание
In SwiftUI, a property wrapper is a Swift language feature that allows you to add a layer of custom behavior to properties. Property wrappers are used to augment the behavior of properties in a concise and reusable way. They are commonly used in SwiftUI for managing state, data binding, and more. We will learn how they work, why they work, and how to make your own!

🤙 WELCOME BACK 🤙

00:00 Property Wrappers
03:12 Welcome back!
05:13 Code start
05:40 Custom Bindings
06:59 When to create Property Wrappers?
09:21 Primary Example Start
17:24 Building a custom Struct
23:13 Mutating Views / Property Wrapper magic
26:29 Dynamic Property
28:20 Converting to a Property Wrapper
35:34 @propertyWrapper
38:47 Adding custom keys
42:55 Initial Wrapped Value
45:32 Projected Value
50:03 Wrapping up
Рекомендации по теме
Комментарии
Автор

That "Ta-Da-DA!" moment is brilliant!

vladimirmoor
Автор

Excellent video, thanks.
Regarding 'atomically', best practice is to use "true" for almost all usage.
It's mostly a safety mechanism. It helps guarantee that the data is correctly written out before any original file is replaced.

wmblemania
Автор

Masterful breakdown on custom Property Wrappers – both parts are gold! 👏🔥

rahulvatakara
Автор

Thanks Nick for investigating property wrappers. And even more thanks for sharing what you've learned !!!! I like the way you share this with your step-by-step approach. It takes me to understand what, why, when and how to use custom property wrappers. Great job !!!

GeraldHilbers
Автор

Thanks, Nick. This content is worth your time in gold.

josemanuelortizsanchez
Автор

Pure brilliant, as always! Thanks, Nick

kameelsuleyman
Автор

Very interesting! Looking forward for the next 3 videos in line :)

VSilverstein
Автор

Excellent video, I learned a lot here.

lidders
Автор

Great detailed explanation. Very easy to understand once it has been explained the way you explain it!

cruiseqe
Автор

Amazing.. it was an epic lecture for sure!

욘슨상
Автор

Amazing content and explanation. Thank you!

glorytoukraine
Автор

So well explained, Thank you so much!

andresraigoza
Автор

but we keep using the @State inside FileManagerProperty... Will that change? I love your videos!

luisgangasvasquez
Автор

You are doing making really nice video.
Looks like you have not committed source code. Can we please have that? Thanks.

Jineshp
Автор

Please make one complete app with proper business's logic in swiftui...

umarparacha
Автор

Really useful.

Discord link invite is not working for me. Can you please help with that.?

MegaAVINASH
Автор

Thanx again for all u do. I could use a property wrapper for SpriteKit and nodes. They are a challenge with Views

rscottlewis
Автор

private let path: URL = {
FileManager.default
.urls(for: .documentDirectory, in: .userDomainMask)
.first!
.appending(path: "custom_title.txt")
}()

fengding
visit shbcf.ru