Member-only story
SwiftUI: Binding
Learn about Binding in SwiftUI
Let me take you to a small, fictitious app named LyricLoop. This app lets users create and share loops of their favorite lyrics from throwback hits. The UI is clean, the interactions are slick but underneath it all, there’s a small, unsung hero named @Binding, pulling the strings behind each user interaction.
In SwiftUI, @State creates a local source of truth. But what if that truth needs to be shared? Like when a user toggles a “Public Loop” setting in the Edit screen, and the Main Profile screen needs to reflect that change immediately.
Enter @Binding
This LoopSettingsView doesn’t own the isPublic state. It borrows it. Like borrowing a vinyl from your friend’s collection but changing the song on your record player, and it changes for your friend too.
Now let’s look at where this borrowed record came from:
The EditLoopView holds the actual state using @State. It then passes that state as a binding using…









