title: How to Dismiss a Storyboard Popover
body: <p>I've created a popover from a <code>UIBarButtonItem</code> using Xcode Storyboards (so there's no code) like this:</p>
  
  <p><img src="https://i.stack.imgur.com/XlQ3d.png" alt="Xcode 5.0 Connections Inspector with Popover"></p>
  
  <p>Presenting the popover works just fine. However, I can't get the popover to <em>disappear</em> when I tap the <code>UIBarButtonItem</code> that made it appear. </p>
  
  <p>When the button is pressed (first time) the popover appears. When the button is pressed again (second time) the same popover appears on top of it, so now I have two popovers (or more if I continuer pressing the button). According to the <a href="http://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW40" rel="noreferrer">iOS Human Interface Guidelines</a> I need to make the popover appear on the first tap and disappear on the second:</p>
  
  <blockquote>
    <p>Ensure that only one popover is visible onscreen at a time. You should not display more than one popover (or custom view designed to look and behave like a popover) at the same time. In particular, you should avoid displaying a cascade or hierarchy of popovers simultaneously, in which one popover emerges from another.</p>
  </blockquote>
  
  <p>How can I dismiss the popover when the user taps the <code>UIBarButtonItem</code> for a second time? </p>