title: UIButton action with UIActivityIndicator
body: <p>I'm trying to deal with such a thing:</p>
  
  <p>I have a <code>UIButton</code> action which is calling <code>UIImagePickerController</code> and presenting it to tak a shoot. But the loading is taking a while - especially at the first run. So I've decided to put a <code>UIActivityIndicator</code>to keep spinning while loading the Camera.</p>
  
  <p>But I faced one problem - <code>UIImagePicker</code> is loading in main thread so the indicator won't show. How can I solve this?</p>
  
  <p>This is my method:</p>
  
  <pre><code>- (IBAction)takePhoto:(UIButton *)sender
  {
      UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
      imagePicker.delegate = self;
      imagePicker.allowsEditing = YES;
      imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
  
      UIActivityIndicatorView *activityView=[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
      activityView.center=self.view.center;
      [self.view addSubview:activityView];
      [activityView startAnimating];
  
      [self presentViewController:imagePicker animated:NO completion:nil];
  }
  </code></pre>