mercredi 26 avril 2017

Disable button good practice in IOS?

I currently have a UIButton in my app when clicked, starts running a block of code that takes awhile to finish so I run it on another queue.

I would like to keep the button enable so that if the user clicks the button in 2 quick succession for example, I would ignore the data returned from the first click and just use the data from the second click. My problem is that I'm worried that the user might click the button 20 or 30 times and my app would create 20-30 queues which would slow the execution?

How would I be able to deal with this? I feel like disabling the UIButton after 1 click is not a good solution.

Aucun commentaire:

Enregistrer un commentaire