0

Imagine a ViewController with 2 UITextFields. When you tap on TextField1, it appears a Popover.

Now, if I tap out of the popover, it disappears (OK). However, I want this behaviour:

  • If I click outside of the popover, and this tap is on TextField2, I want to dismiss the popover (OK), AND throw an event (for example, open other popover from TextField2).

I've tried this solution: Iphone SDK dismissing Modal ViewControllers on ipad by clicking outside of it

But handleTapBehind method doesn't execute if popover is visible.

Is it possible?

Thanks!

Community
  • 1
  • 1
Josue
  • 725
  • 2
  • 10
  • 22

1 Answers1

0

you should implement UIPopoverControllerDelegate

and use

popoverControllerShouldDismissPopover:
popoverControllerDidDismissPopover:

see More for details

Muhammad Idris
  • 2,138
  • 1
  • 13
  • 9
  • I've already implemented. But with these methods I only receive by parameter the UIPopoverController reference. I need the bounds of the tap to know If user has tapped on another view (for example, a Textfield, button, etc.) – Josue Nov 14 '13 at 09:51