Quantcast
Channel: Prevent multiple Tap on the same UIButton - Stack Overflow
Viewing all articles
Browse latest Browse all 11

Answer by Santo for Prevent multiple Tap on the same UIButton

$
0
0

You can disable the userInteraction for that button when user taps for first time.

Then new view controller will appear, while leaving to new View Controller call this

 -(IBAction)btnAction:(UIButton *)sender {   sender.userInteractionEnabled=NO;  //do your code  }

if it is moving to another view then call below one

 -(void)viewWillDisappear {  buttonName.userInteractionEnabled=YES; }

if not moving from present view you can call

  sender.userInteractionEnabled=YES;

at the end of btnAction method.

It will work for sure.


Viewing all articles
Browse latest Browse all 11

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>