Roi Mulia
Roi Mulia

Reputation: 5896

Swift/XCODE - Unable to press(touch) fast on a UIButton

i have a singe view screen , with a button inside that covers the whole screen. i'm not able to press it very fast,it's stuck sometimes. i have played the game Piano Tiles and you can press fast on the buttons with no stucks. so this is my questions : 1) is it possible to press very fast multiply times on a UIButton? 2) What is touch down repeat option when connecting the button to the code(the action)

i have set the action to touch down so it will be as fast as i can but still dosent flow right. any suggestions?

Upvotes: 1

Views: 764

Answers (1)

Sandy Chapman
Sandy Chapman

Reputation: 11341

I've not run into that problem before, but you may want to consider adding a UITapGestureRecognizer to your ViewController's main view, and using that for detecting your taps instead of a UIButton.

Here's Apple's official docs.

This is a also a decent tutorial on it using Swift. I'd recommend the Programmatic UIGestureRecognizers for a quick setup and go.

Upvotes: 1

Related Questions