iOS 8b5: Clicking UIActionSheet button in popover dismisses the presented view controller underneath
| Originator: | sebastian | ||
| Number: | rdar://18173145 | Date Originated: | |
| Status: | Open | Resolved: | |
| Product: | iOS | Product Version: | iOS 8.0 beta 5 (12A4345d) |
| Classification: | Reproducible: | Always |
Summary: The introduction of UIAlertController seems to have caused a regression in the way the old UIActionSheet handles clicking of its button. It seems that, when any of the buttons in the action sheet is clicked, -[UIViewController dismissViewControllerAnimated:completion:] seems to be called behind the scenes. This was not the case in iOS 7, and I suspect it is a result of the fact that the new UIAlertController is a presented view controller in itself. The result is that if I show an UIActionSheet from a view controller that was itself presented, for examples on the iPad, clicking the button will not only dismiss the popover, but also dismiss the underlying presented view controller. Please find a demo project attached that shows the behavior. Compare how it runs on iOS 8 vs 7. Steps to Reproduce: 1. Create an iOS project for iPad, run it on iOS 8 beta 5 2. First, present a view controller using presentViewController:animated:completion: 3. From the presented view controller, show an UIActionSheet in a popover from within the presented view controller. 4. When any of the buttons in the action sheet are clicked, BOTH the popover and the view controller presented in (2) will be dismissed due to the fact that -[UIViewController dismissViewControllerAnimated:completion:] is now being called behind by the OS when the button is clicked. 5. Run the same example on iOS 7. The presented view controller from (2) will stay on screen after the popover with the action sheet has been dismissed. This is the expected, correct behavior. Expected Results: After clicking a button in the UIActionSheet presented in a popover, the popover should be dismissed but the underlying presented view controller should stay on screen. Actual Results: After clicking a button in the UIActionSheet presented in a popover, both the popover and the underlying presented view controller are dismissed. Version: iOS 8.0 beta 5 (12A4345d) Notes: Configuration: Xcode 6 beta 6, iPad Air Simulator
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!