Type Safely

Type Safely

Specify The Animation That Happens When a Toggle Changes State

Daily Coding Tip 193

Type Safely's avatar
Type Safely
Oct 12, 2022
∙ Paid
green light bulb on white surface
Photo by Isaac Li Shung Tan on Unsplash

It’s possible to specify an animation when adding a Binding<Bool> to a Toggle.

I expected $myBinding.animation() would return an animation, and it would therefore not be suitable for use as a Binding<Bool>.

However, it turns out that this function is really just informing SwiftUI of your intention without actually r…

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