Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
You can disable the button in your action method when it receives the first tap. Alternatively you can just ignore the second tap while it's doing something.

button.isEnabled = false
 
  • Like
Reactions: DennisBlah

theprizerevealed

macrumors regular
Original poster
Feb 26, 2016
183
12
Thank you for your reply, although your answer would be helpful during certain scenarios that I might encounter; it interferes with other code that I might wish to implement in the button and the graphical user effect is not quite suitable. I found another snippet of code that I thought I should share because it works nicely: it controls the responsiveness of a particular button without affecting the entire button code

Code:
 self.buttonname.isUserInteractionEnabled = false

A modified version of this code snippet can affect the whole view controller after pressing a particular button

Code:
 self.view.isUserInteractionEnabled = false
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.