title: Don't allow user interaction when activity indicator view is visible
body: <p>I have a view which contains two views. One of those views contains two buttons and some text labels. The other one, with alpha set to 0.25, has an <code>UIActivityIndicatorView</code> to tell the user that the app is working and he must wait until it finishes. If the user touch a button while the <code>UIActivityIndicatorView</code> is spinning, when the <code>UIActivityIndicatorView</code> stops, the app remember the user action and responds to it. How can I discard the user interaction that occur while the <code>UIActivityIndicatorView</code> is spinning?</p>
  
  <p>Thanks for reading.</p>
  
  <p>P.D.: Like is commented in <a href="https://stackoverflow.com/questions/446077/iphone-development-restrict-user-interaction-with-application-and-show-a-progre">this thread</a>, I prefer do not to use any modal solution.</p>
  
  <p><strong>EDITED:</strong></p>
  
  <p>I am currently using this code and it does not work right.</p>
  
  <pre><code>- (void)viewDidAppear:(BOOL)animated {
  
    // The view appears with an UIActivityIndicatorView spinning.
    [self showResults]; // The method that takes a long time to finish.
    [self.activityIndicator stopAnimating];
    // When the showResults method ends, the view shows the buttons to the user.
    [self.activityIndicatorView setHidden:YES];
    [self.menuButton setEnabled:YES];
    [self.menuButton setUserInteractionEnabled:YES];
    [self.playButton setEnabled:YES];
    [self.playButton setUserInteractionEnabled:YES];
    [self.view setUserInteractionEnabled:YES];
    [self.interactionView setUserInteractionEnabled:YES];
  }
  </code></pre>