I have discovered a situation that causes dismissViewController:animated:completion
to not dismiss the view controller that has been presented. While it does dismiss on iPad running iOS 8, it doesn't dismiss on iPad running iOS 7.1. I've tried self
, self.presentingViewController
, and self.presentedViewController
- all do nothing. I've tried it with Xcode 6.0 and 6.1 beta. While I do believe this is a bug, what can be done to work around it and force dismiss that view controller, ensuring it will work for iPad running iOS 7 and 8 (presented as a popover), and iPhone running iOS 7 and 8 (presented full screen)?
I have created a very simple project you may use to try this: Xcode project zip.
Project setup:
- Universal storyboard targeted to iOS 7+
- Implement Popover Presentation segue
- Implement ability to dismiss popover inside that popover
To encounter the unexpected behavior:
- Open the provided Xcode project
- Run the app on iPad iOS 7 Simulator
- Tap the top cell to present the popover
- Tap the cell in the popover to dismiss it