Type Safely

Type Safely

Use a Long Press Gesture To Toggle a Boolean State Back To False

Daily Coding Tip 130

Millie Sturgeon's avatar
Millie Sturgeon
Jul 19, 2022
∙ Paid
body of water surrounded by trees
Photo by Bailey Zindel on Unsplash

Sometimes you want to be sure that a touch gesture is being done deliberately.

A regular tap for instance can be done accidentally when the user is trying to scroll and, when using a Toggle, it can lead to a state that was set to true being reverted back to false. In order to make it harder to undo an action, I’m going …

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