Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIPopoverController dismiss on 'tap off' - how do I detect this event?

I am using a UIPopover on my navigation bar. I have several UIBarButtonItems and the popover extends from one of these.

When the popOver is activated I changed the style of the button to UIBarButtonItemStyleDone.

However, the popOver is dismissed by tapping off the UIPopoverController as expected, but upon this I want to change the style back to UIBarButtonItemStyleBordered.

Is there a way I can detect if the UIPopOverController is closing? And therefore piggyback this for my own needs?

like image 274
Dan Hanly Avatar asked Jun 02 '11 09:06

Dan Hanly


1 Answers

Implement the -popoverControllerDidDismissPopover: method in your UIPopoverControllerDelegate and you should be able to do what you need to do in there.

- (void) popoverControllerDidDismissPopover:(UIPopoverController *) popoverController {
   //do stuff here...
}
like image 87
Jacob Relkin Avatar answered Oct 16 '22 15:10

Jacob Relkin