UISplitViewController – Pushing Modal View
What is considered the best practise when pushing a modal view when using a UISplitViewController? Would you push from the RootViewController, the DetailViewController or directly from the Application Delegate?
Ideally the functionality I am trying to achieve is to have the modal view controller displayed as soon as the UISplitViewController is loaded based on certain conditions.
Thanks in advance for any pointers on this matter.
- How do I add a custom view to iPhone app's UI?
- How to use a UISplitViewController in Swift
- Good iPad SplitViewController tutorial?
- How to inform the parent viewcontroller about the changed screen orientation in the modal view controller?
- Using Multiple Detail Views with Split View Controller
- UISplitViewController within UITabbarController Swift
2 Solutions Collect From Internet About “UISplitViewController – Pushing Modal View”
I was trying to do the exact same thing, and I’ve come up with the following answer: it’s simpler to do it from the App Delegate.
In Portrait mode, the RootViewController is created in a strange way (popover) so it’s not practical, the Application Delegate ensures your view will show properly in all cases. I can’t remember what was the issue with doing it in the DetailViewController though.
EDIT: the actual implementation in
application:didFinishLaunchingWithOptions: is something like that:
[splitViewController presentModalViewController: modalViewController animated: NO];. Hope this helps!
I actually ran across the same issue and made this post:
presentModalViewController slides a new view too far up and goes above the top of the screen
Basically, when you call a modal view from the detail view, the program explodes with problems with many to do with rotating while on the modal view.
Bottom line, always call a modal view from the root view controller.
- How can I replicate UINavigationBar's gradient colors?
- Silent pushes not delivered to the app on iOS 11
- Convert Optional string to date
- UITableView insertRowsAtIndexPaths:WithRowAnimation without freeze UI
- set status bar?
- Failed to emit precompiled header for bridging header
- Cannot dismiss email sheet invoked from UIDocumentInteractionController in iOS 8
- Warning is not displayed in Xcode Issue Navigator
- no response for iPad to show excel cell data
- App Crashing Entire Device On Segue for iOS 9 + Xcode 7
- Guitar tuner frequency
- Objective C – How do I use initWithCoder method?
- Moving localization folders in Xcode 4
- cpprestsdk: Undefined symbols for architecture x86_64
- Passing custom data in