title: Storyboard UIImagePicker overlay UIButton does not dismiss preview
body: <p><strong>update 2</strong></p>
  
  <p><code>viewDidAppear</code> is executed twice, once before and once after, the overlay button is touched. Would a fix be to add a conditional to <code>viewDidAppear</code> which would return control to the calling class? If so, I would appreciated suggestions. Or maybe the very fact that <code>viewDidAppear</code> execute twice suggests another approach to a fix?</p>
  
  <p><strong>update 2</strong></p>
  
  <p><strong>update 1</strong></p>
  
  <p>Maybe the problem is my usage of <code>viewDidAppear</code> and <code>viewDidLoad</code> shown below. Can anyone help, please?</p>
  
  <pre><code>- (void)viewDidAppear:(BOOL)animated
  {
  
      self.overlayViewController = [[BSsetupOverlayViewController alloc] initWithNibName:@"BSsetupOverlayViewController" bundle:nil] ;
  
      // as a delegate we will be notified when pictures are taken and when to dismiss the image picker
      self.overlayViewController.delegate = self;
  
  
      [self showImagePicker:UIImagePickerControllerSourceTypeCamera];
  
  }
  
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view from its nib.
  }
  </code></pre>
  
  <p><strong>update 1</strong></p>
  
  <p><strong>update 0</strong></p>
  
  <p>Perhaps I was not clear that the difference between the version that does not work and the one that does is that Storyboard is used in the one that does not work. Why would a <code>done</code> button work without Storyboard, but not with, even though only a nib is involved with the overlay?</p>
  
  <p><strong>update 0</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/15623754/camera-overlay-picture/">The UIButton here</a> was able to dismiss the camera preview, but in my actual app, tapping the UIButton only temporarily dismisses the preview and overlay screen. Immediately the preview returns. I think the problem is with the way I am implementing the delegate to the UIImagePicker, but I may be wrong.</p>
  
  <p><a href="http://schott.selfip.net/~brian/" rel="nofollow noreferrer">I have created <code>setup.zip</code> here</a> which contains a sample project with the undesirable behavior.</p>