I have this UIPopOverScreen that shows when I press a NavigationBar Button.
The problem I want to dismiss it whenever I touch anything outside that popoverscreen.
It partly works but it doesn’t dismiss when touching the navigationbar which has been built into the VC that calls the popoverscreen.
I’ve tried several options to make it disappear but it just hasn’t worked yet.
The best results I’ve gotten when I set:
self.popOverController.passthroughViews = nil;
It worked as I wanted but by just setting this you have to press the navigationbar twice to make it respond again.
I would love to hear your thoughts about a clean solution.
How about adding a UITapGestureRecognizer to react to a tap on the navigation bar? Save a reference to the active Popover and dismiss it by calling a method when the navigation bar receives a tap.