Trying to make storyboard based application for iPad. In it I need to transition from start screen (UIViewController) to main screen (UISplitViewController) and then to full-screen view (again UIViewController).
I saw a number of discussions on the web (at least several - on stackoverflow), stating that UISplitViewController can't be used in Storyboard based application any other way than being RootViewController. Some threads contain workarounds and there's also alternative splitview (https://github.com/mattgemmell/MGSplitViewController) to cope with this.
But what I can't understand is why Apple documentation states quite the opposite. Here is the link to the chapter from Apple's iOS 5.0 Library. It states:
To add a split view controller to your application’s storyboard:
To present the split view interface, do one of the following:
I was trying it in many ways, but approaches described in last two statements never worked. Both modal segue and performSegue... fail with well-known error:
"*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a Split View Controllers modally..."
Anyone able to explain that? Is this a bug in XCODE/iOS 5.0 or bug in documentation?
Regards, Petr
According to this Apple article, the split view controller must be the root. Here is a snippet:
A split view controller must always be the root of any interface you create. In other words, you must always install the view from a UISplitViewController object as the root view of your application’s window. The panes of your split-view interface may then contain navigation controllers, tab bar controllers, or any other type of view controller you need to implement your interface. Split view controllers cannot be presented modally.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With