UIPopoverPresentationController dismissal with double tap on dimming view inadvertently dismissed parent view controller
| Originator: | sohail | ||
| Number: | rdar://18481560 | Date Originated: | September 28, 2014 |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 8.0 |
| Classification: | Reproducible: | yes |
Summary: Using the new iOS8 UIPopoverPresentationController approach to presenting popovers, I experienced a situation (easy to repeat in my codebase) where tapping once in the dimming region to dismiss the popover works, but performing a double tap not only dismissed the popover, it triggered a dismissal on the parent view controller defining the presentation context. In my situation, I have a container view controller that comes on screen in stock modal fashion. It is a container for several child view controllers, one of which uses the UIPopoverPresentationController approach to present a popover. The child view controller that requests the presentation of the view controller configured for UIModalPresentationPopover style never received a dismissViewControllerAnimated:completion: call, but its parent view controller (show in the debug screenshot attached) does. It seems like without a UIPopoverPresentationControllerDelegate defined that implements the delegate method 'popoverPresentationControllerShouldDismissPopover:', your internal/private method 'dimmingViewWasTapped:' is jumping to the presentation context controller and invoking 'dismissViewControllerAnimated:completion:' on it. Steps to Reproduce: See code snippet example here: http://stackoverflow.com/a/26085641/535054, used in conjunction with the view controller hierarchy described in the Description section above. Expected Results: I expected the popover to dismiss, but no other side effects, from a double tap on the dimming view setup by the popover's presentation. Actual Results: The popover is dismissed, and the presenting view controller is also dismissed! Version: Xcode 6.0.1 (6A317), iOS8 Notes: My workaround posted on stack overflow: http://stackoverflow.com/a/26085641/535054 Configuration: iPad Air simulator Attachments: 'Dimming_View_Tapped_is_telling_the_last_modal_presentation_to_dismiss.png' was successfully uploaded. See: https://www.evernote.com/shard/s4/sh/fe256e3d-3c22-4440-8e05-3803e56b6076/e57a5ee38d25bba869336ea714c563c2/deep/0/Dimming-View-Tapped-is-telling-the-last-modal-presentation-to-dismiss.png
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!