Type Safely

Type Safely

Turn Any View Into a Toggle Using One Simple Modifier

Daily Coding Tip 095

Millie Sturgeon's avatar
Millie Sturgeon
Jun 01, 2022
∙ Paid
Image by Evgeni Tcherkasski from Pixabay

In yesterday’s Daily Coding Tip I was talking about adding a @State property wrapper to a ViewModifier, but what happens when I use a @Binding?

It’s pretty easy to have a Button that uses the view as a label, and it’s easy to toggle a Binding<Bool> as well.

User's avatar

Continue reading this post for free, courtesy of Type Safely.

Or purchase a paid subscription.
© 2026 Type Safely · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture