views:

82

answers:

1

I'm trying to dismiss any currently visible UIPopoverControllers if/when another UIBarButtonItem is tapped as seen on Pages for the iPad when tapping between Styles/Media/Tools etc.

I've done this, but it's too specific. Looking for something generic.

if ([popoverController isPopoverVisisble]) {
[popoverController dismissPopoverAnimated:YES];
}

Thanks!

A: 

Did you set the passthroughViews property of the popover controller? If you do this, then taps outside the popover will not cause the popover to automatically dismiss, but will instead be sent to the views in that array. You should be able to add the UIBarButtonItem to this array, and then dismiss the popover in that handler.

randallmeadows