title: Dimming the main view when called Popover
body: <p>There is a basic form, pressing button call method <code>performSegueWithIdentifier</code> which shows the popover window.  How could I black out (dim)  the main view window until the popover is active?</p>
  
  <p>I've tried to use the library <a href="http://github.com/samvermette/SVProgressHUD" rel="nofollow">SVProgressHUD</a>  like this:</p>
  
  <pre><code>- (IBAction)publishButtonAction:(id)sender {
      [SVProgressHUD showWithMaskType:SVProgressHUDMaskTypeBlack];
      [self performSegueWithIdentifier:@"fbshareSigue" sender:self];
      [SVProgressHUD dismiss];
  }
  </code></pre>
  
  <p>Obtained for a split second - until there is a popover-window.</p>
  
  <p>Where must I insert this code, if I try this?:</p>
  
  <pre><code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
  
      if ([[segue identifier] isEqualToString:@"fbshareSigue"]) {
          OFAFBShareViewController *svc = (OFAFBShareViewController *) [segue destinationViewController];
          UIStoryboardPopoverSegue *popoverSegue = (UIStoryboardPopoverSegue *)segue;
          svc.postBlock = self.postInitBlock;
          [svc setClosePopWindow:[popoverSegue popoverController]];
      }
  }
  
      - (IBAction)publishButtonAction:(id)sender {
          UIView *dimView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
          dimView.backgroundColor = [UIColor blackColor];
          dimView.alpha = 0.5f;
          dimView.tag = 1111;
          dimView.userInteractionEnabled = NO;
          [self.view addSubview:dimView];
  
          [self performSegueWithIdentifier:@"fbshareSigue" sender:self];
  }
  
    /* This code should be put in the other method where you are removing the popup.. Because it will remove the dim view. here is the wrong place for this code*/  
  
   /* for (UIView *view in [self.view subviews]) {
          if (view.tag == 1111) {
              [view removeFromSuperview];
          }
      }*/
  </code></pre>
  
  <p>Dim doesn't work...</p>
  
  <p>====================</p>
  
  <p>I have View <code>OFAResultViewController</code> that calling Popover (<code>OFAFBShareViewController</code>):</p>
  
  <pre><code>...
  - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
  
      if ([[segue identifier] isEqualToString:@"fbshareSigue"]) {
          OFAFBShareViewController *svc = (OFAFBShareViewController *) [segue destinationViewController];
          UIStoryboardPopoverSegue *popoverSegue = (UIStoryboardPopoverSegue *)segue;
          svc.postBlock = self.postInitBlock;
          [svc setClosePopWindow:[popoverSegue popoverController]];
      }
  }
  
  - (IBAction)publishButtonAction:(id)sender {
      UIView *dimView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
      dimView.backgroundColor = [UIColor blackColor];
      dimView.alpha = 0.5f;
      dimView.tag = 1111;
      dimView.userInteractionEnabled = NO;
      [self.view addSubview:dimView];
      [self performSegueWithIdentifier:@"fbshareSigue" sender:self];    
  }
  ...
  </code></pre>
  
  <p>In <code>OFAFBShareViewController</code> I'm trying to close the dim view:</p>
  
  <pre><code>...
  - (IBAction)cancelButtonAction:(id)sender {
      [closePopWindow dismissPopoverAnimated:YES];
      for (UIView *view in [self.view subviews]) {
              if (view.tag == 1111) {
                  [view removeFromSuperview];
              }
  }
  ...
  </code></pre>
  
  <p>But it doesn't work again...</p>