0

For some reason my UIButton requires two taps to trigger and I don't understand why, this is not the desired functionality and all of my other buttons work as expected

Here is the addTarget code:

[self.myButton addTarget:self action:@selector(publishButtonTapped) forControlEvents:UIControlEventTouchUpInside];

My function publishButtonTapped is not triggered until the second tap in quick succession.

There must be something else I am overlooking, so any insight appreciated

My button and layout is created programmatically, so there is no XIB or storyboard.

CQM
  • 42,592
  • 75
  • 224
  • 366
  • this might occur, when you have any tap gestures enabled on the view that contains the button – Teja Nandamuri Oct 27 '15 at 16:06
  • are you sure you dont have any other tap gestures present in the view ? – Teja Nandamuri Oct 27 '15 at 16:07
  • if you have any tap gestures in your view, this should solve your problem. http://stackoverflow.com/questions/4825199/gesture-recognizer-and-button-actions – Teja Nandamuri Oct 27 '15 at 16:10
  • @Mr.T thanks, I ended up making the button bigger. Strange because I have smaller buttons that are more responsive. I will look at your suggestions because it sounds on track – CQM Oct 27 '15 at 16:12
  • @Mr.T I got it, there was another way to arrange all of my views, thanks for the hint about conflicting tap gestures! – CQM Oct 27 '15 at 16:45

0 Answers0