1

For an App I'm working on I want to create a specific LongPressGesture.

It shouldn't be triggered before a custom time amount (maybe 2 seconds, doesn't really matter), but it also should only be triggered, when you released the Button (I know it's not a Button but I like to call it this way) after the custom time amount.

So For Example, I have a Button. When I Press it for One Seconds, nothing should happen. It has to be pressed for a minimum amount of time (e.g. 2 Seconds) seconds, but also then, the event also only should happen, when the user releases the Button.

I hope this is somewhat understandable.

I've tried many things like .onLongPressGesture() with .onChanged and .onEnded, but I couldn't figure a way out to make this work.

I would appreciate any help. Thank you.

kq_luis
  • 11
  • 1
  • already solved here checkout https://stackoverflow.com/questions/58284994/swiftui-how-to-handle-both-tap-long-press-of-button – belal medhat Jan 08 '22 at 18:12
  • You can get check this link maybe this could be your required answer. https://stackoverflow.com/a/58643879/13947836 – Ronak Patel Jan 17 '22 at 06:57

0 Answers0