Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9075067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:47:00+00:00 2026-06-16T18:47:00+00:00

I have a problem dismissing a popover that was launched from the navigationItem of

  • 0

I have a problem dismissing a popover that was launched from the navigationItem of a UINavigationController. It seems that the navigation item which is inserted by the UINavigationController does not trigger dismissal of the UIPopoverController. Usually, when you tap outside a popover, it is dimissed. But when you tap on the navigation item, the popover is not dismissed. Worse, if you tap the button which triggers the popover, you’ll get a second instance of the popover.

All of this is done using storyboards:
– Create a view, embed it into a UINavigationView so it gets a navigationItem on the top.
– Put a UIBarButtonItem into the navigationItem (left or right, doesn’t matter for the initial view on the navigation stack).
– Define another view, and drag a segue from the UIBarButtonItem to this view.
– Set the segue to be popover.

Once the popover is open, I cannot dismiss it by tapping on the navigationItem. I cannot believe this “works as designed”, so I suspect I missed out on somthing.

Although my goal is to program as little as possible (that’s what storyboards are about, aren’t they?), I thought about workarounds: The first workaround that came to my mind was to add a UITapGestureRecognizer to the navigationItem, which would dismiss the popover when it detected a tap on the navigationItem. Unfortunately, the navigationItem seems to not be UIVIew, so it lacks the addGestureRecognizer: method…

EDIT: Adding a UITapGesturerecognizer to self.navigationController.navigationBar is possible, but prevents any tap to reach the UIBarButtonItems on the navigationBar. Yes, I could have expected that.

Thanks a lot for help,
nobi

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:47:01+00:00Added an answer on June 16, 2026 at 6:47 pm

    Here’s the complete description for popovers in storyboards. Assuming your controller to appear in the popover is named MyPopupController, do this:

    1. Define a segue from the main scene to the MyPopupController scene, using style Popover.
    2. Add a property to MyPopupController.h

      @property (weak, nonatomic) UIPopoverController *popover;
      
    3. Synthesize the property in MyPopupController.m

      @synthesize popover = _popover
      
    4. In the prepareForSegue:sender: method of the main scene controller, set up the popoverproperty:

      UIStoryboardPopoverSegue *ps = (UIStoryboardPopoverSegue *)segue;
      MyPopupController *dc = ps.destinationViewController;
      dc.popover = ps.popoverController;
      
    5. In the viewWillAppear: method of MyPopupController, add the following code (don’t forget [super viewWillAppear] as well):

      self.popover.passThroughViews = nil;
      

    You should be done now.

    Thanks to Robert for the basic idea – I just had to find the correct place because presentPopoverFromBarButtonItem is not used when using storyboards. Note that putting (5) into viewDidLoad does not work.

    Have fun coding!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with presenting and dismissing a modalViewController that contains a tabBarView
I have problem with UIWebView delay when the load image from url. In my
I have a root view controller, which serves as a menu. When an item
i have a little problem with dismissing my camera view. im using the UIImagePickerController
A very peculiar bug: I have BarButtonItem which pops out a UIPopoverController like that:
I'm new to iOS and I have a problem in dismissing an UIAlertView programmatically.
i have a UIWebView on a modal view. The problem is that when the
I need a little help on a problem with navigation controllers. I have a
I have a UIActionSheet that displays various buttons, one of which posts a tweet
I have problem with http://abfoodpolicy.com/ . In IE 8 and 9 the right sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.