I have a UIButton that trigger the IAP process. There is some time (2/3s or more if internet connection is bad) before an alert view is displayed (either asking for id and password, or the confirmation one). So one may click several times, thinking that the button is not working. And then you get as much alert view in a row as times you clicked and they are shown even if I quit the app and I'm on another meanwhile. That's pretty annoying.
My solution so far is to set a boolean as property of the UIviewcontroller. If it's false, click does nothing, else click trigger payment process. I set it to false on first click and in viewwillappear i get it back to true. The problem is that to be able to click the button again you must leave view and come back to it. That's not cool...
So here is what I'm looking for ideally : a function that is triggered as soon as any alert view of any kind is shown or dismissed. Show is better because i could use that to stop an eventual activity indicator I'd like to add too.
Thank you for you ideas.