2. Remove effect only on touch up, don’t automatically remove it after a time period:
I see lots of buttons now a days that are animated on a timer, instead of the actual input of the user. This is how all buttons should be if you ask me: 1. Show effect on touch down:
4. Keep the effect on while the touch is down so the user can change their mind about canceling and move the touch back on the button:
This one I disagree with. As a user this makes me feel like the button’s action will still be triggered if I lift my finger outside of the button. Instead, I would toggle the visible state of the button as the user’s finger moved in and out of it.
Well, I got curious as well. So here you go! I have to say it’s been a while since I worked in SwiftUI and I worked on it for maybe 2 hours, so the code could probably be better. But it seems to work pretty good. github.com/CollinHemeltje…
This is way better than using the pressed value for the button. Does it bounce even for small touches? Sometimes with button you kind need to “long touch” for it to bounce
Animations here are set to 0.1s, so maybe if your tap is quicker than that the button won’t completely bounce. But it seems to react well to my short touches