iosobjective-cuipopover

Disable uipopover tap gesture recognizer


I know that UIpopover will be dismissed automatically when you tap outside of the popover.

I need to disable tap recognizer, because I have 4 buttons each of which present popover and when you tap another button another popover must be shown.

When I tap another button first popover is disappearing (I can handle it programmatically) but second button's function is not calling because tap is already "consumed".

I tried to remove tap gesture recognizer from popover but no success.

enter image description here


Solution

  • You could assign the buttons to the popover presentation controller's passthroughViews array to allow interaction while the popover is visible.

    https://developer.apple.com/documentation/uikit/uipopoverpresentationcontroller/1622312-passthroughviews?changes=_4