Don't allow user interaction when activity indicator view is visible
I found these methods very useful:
[[UIApplication sharedApplication] beginIgnoringInteractionEvents];[[UIApplication sharedApplication] endIgnoringInteractionEvents];
In Swift 3.0To Disable interaction :-
UIApplication.shared.beginIgnoringInteractionEvents()
To restore interaction :-
UIApplication.shared.endIgnoringInteractionEvents()
[_button setUserInteractionEnabled:NO];
That should disable it, just set YES for when you want to user to tap it.
BOOL i_am_ready_to_submit = NO;-(void)action_finished{[self.activityIndicator stopAnimating];i_am_ready_to_submit = YES;}-(IBAction)submit_button{if(i_am_ready_to_submit){[self submit];}}