How to make Buttons detect tap, double tap and long press gestures in SwiftUI

Federica Benacquista
3 min readAug 7, 2023

Ahhh taps, such an easy task. Well at least until making them work properly confused the hell out of me.

So… I see you want to code a juicy multitasking button that does an endless amount of things depending on how you touch it, yet WITHOUT sacrificing the basic Button functionality (e.g. highlight, fade out and all of that nice…

--

--

Federica Benacquista

I’m a self taught iOS developer and soon to be entrepreneur. I like to explain tricky concepts as easily as possible and it’s exactly what I do here.