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

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2024
  • 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 🤙
    WEBSITE: www.swiftful-thinking.com
    DISCORD: / discord
    GITHUB: github.com/SwiftfulThinking/
    SAY THANKS: www.buymeacoffee.com/nicksarno
    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

ความคิดเห็น • 26

  • @vladimirmoor
    @vladimirmoor 8 หลายเดือนก่อน +2

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

  • @w0mblemania
    @w0mblemania 8 หลายเดือนก่อน +1

    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.

  • @asigivati1382
    @asigivati1382 23 วันที่ผ่านมา

    one of the best tutorial ever!

  • @rahulvatakara
    @rahulvatakara 9 หลายเดือนก่อน

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

  • @kamilsuleymanov7197
    @kamilsuleymanov7197 8 หลายเดือนก่อน

    Pure brilliant, as always! Thanks, Nick

  • @cruiseqe2
    @cruiseqe2 9 หลายเดือนก่อน

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

  • @VSilverstein
    @VSilverstein 9 หลายเดือนก่อน

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

  • @vladislav2587
    @vladislav2587 9 หลายเดือนก่อน +2

    Brilliant!

  • @lidders
    @lidders 9 หลายเดือนก่อน +1

    Excellent video, I learned a lot here.

  • @GeraldHilbers
    @GeraldHilbers 8 หลายเดือนก่อน

    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 !!!

  • @andresraigoza2082
    @andresraigoza2082 5 หลายเดือนก่อน

    So well explained, Thank you so much!

  • @glorytoukraine6956
    @glorytoukraine6956 5 หลายเดือนก่อน

    Amazing content and explanation. Thank you!

  • @user-vl6bc6ch2z
    @user-vl6bc6ch2z 3 หลายเดือนก่อน

    Amazing.. it was an epic lecture for sure!

  • @sergiocardoso8191
    @sergiocardoso8191 8 หลายเดือนก่อน

    Amazing explanation, thank you!!!

  • @josemanuelortizsanchez4983
    @josemanuelortizsanchez4983 8 หลายเดือนก่อน

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

    • @SwiftfulThinking
      @SwiftfulThinking  8 หลายเดือนก่อน

      Thanks Jose! I love seeing familiar faces in the comments 👍

  • @malithmadhushanka3192
    @malithmadhushanka3192 5 หลายเดือนก่อน

    Thank you Nick,

  • @wonton120
    @wonton120 9 หลายเดือนก่อน +1

    Good tutorial.

  • @SuCodee
    @SuCodee 9 หลายเดือนก่อน

    thank you man

  • @shur_up931
    @shur_up931 9 หลายเดือนก่อน

    ty

  • @luisgangasvasquez6048
    @luisgangasvasquez6048 9 หลายเดือนก่อน +2

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

  • @rscottlewis1
    @rscottlewis1 9 หลายเดือนก่อน

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

  • @MegaAVINASH24
    @MegaAVINASH24 9 หลายเดือนก่อน +1

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

    • @SwiftfulThinking
      @SwiftfulThinking  9 หลายเดือนก่อน

      Try this one: discord.gg/VDTvTNvcXP

  • @umarparacha653
    @umarparacha653 9 หลายเดือนก่อน

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

  • @Jineshp1142
    @Jineshp1142 9 หลายเดือนก่อน

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