SwiftUI - @Binding Property Wrapper Explained - Passing Data

preview_player
Показать описание
In today's video I show you how to pass data between two views in SwiftUI. In this particular example we use the @Binding property wrapper in SwiftUI. I show you how a button tap from a modal view can change the data on the parent view. This tutorial was created in Xcode 12.4.

If you like my teaching or presentation style, I've started creating my own courses:

Twitter:

Link to my book - How I Became an iOS Developer:

Check out my podcast, iOS Dev Discussions:

Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):

Ray Wenderlich Books:

Ray Wenderlich Videos:

Paul Hudson's Hacking With Swift:

Learn Advanced Swift Here:

Links to my iOS Dev Setup & iOS Dev Book Recommendations

#swift #softwaredeveloper #iosdeveloper
Рекомендации по теме
Комментарии
Автор

If you enjoy my teaching/presentation style, I've started creating my own iOS development courses at seanallen.teachable.com. You can watch the first ~10% for free to get a feel for them.

seanallen
Автор

You literally saved me from stop coding forever. Love it.

prettygirl
Автор

I really appreciate the disclaimer and pointing me in the right direction for passing in at deeper levels. Thanks!

TidalWaveDan
Автор

As always, very clear explanation. I really appreciate your content and style! Thanks for what you do for the community!

KimbrellBrad
Автор

I'm making an app for my internship this summer (Never used swift before last month) and this is exactly what I was looking for. You're a lifesaver, thank you!!!

traftonreynolds
Автор

Nice tutorial, getting lots of tips from the video

delask
Автор

Love your channel Sean. Subscribed!!!!

coolisfoolable
Автор

Thanks for this easy to understand video :)

mayankbhaisora
Автор

Thanks for sharing this awesome video!, But i have a question is it possible to pass @Published property in ViewModel to custom SwiftUI View expecting @Binding property

ahmadkhattab
Автор

Great Video👍🏽🤩, SFsymbols actually can use the .font modifier to change the size tho. Apple have seen that as a Text even though it’s called inside Image().

terrykuo
Автор

Thank you very much. Your videos are really great and useful.
Peter

peterplass
Автор

Great content, i appretiate the disclaimer. Not because you can do it that you should #facts

edyarro
Автор

Like .constant(false) in the preview section, what do you write down when your binding is a string not a bool?

love your videos btw! very easy to understand!

yrac
Автор

What if the variable in parent is optional ?

prajaktanisal
Автор

Great video. What's the proper way to pass a string that is a part of an array?

cashbackhouses
Автор

How do you do this exact same thing but using @AppStorage? I figure I could replace the @State with a properly formatted @AppStorage but that didn’t work. I only updates the first string with the first thing typed in the modal (I am trying to pass a string). Of course when I close it or do something else on the first screen it updates, but not when I slide the modal back down. Thanks.

AZMerf
Автор

Really cool, but what is the meaning of @State and the usage of dollar before variables call?

fantomchris
Автор

One thing to note is that binding properties don’t have to be named the same for them to be binded

oxirosmusic
Автор

The contrast between the bald head and the lush beard made me feel so interesting that I was a little distracted. Dude, don't get me wrong, I mean very sexy

bronnstorm