I have an iPhone app and now I am trying to create an iPad version of it. I have an iPhone storyboard and now an iPad storyboard. My iPhone has two UIViewControllers that have associated .m and .h files (Pane1ViewController and Pane2ViewController) that I built using storyboard, with storyboard IDs "pane1" and "pane2."
I have a SplitViewController in my iPad storyboard and I'd like to use "pane1" and "pane2" for the two views in the split view. How can I do this so that it inherits all the UI elements as well as uses the existing .m and .h files associated with those two view controllers?
Use [[UIDevice currentDevice] userInterfaceIdiom to differentiate between iPad and iPhone
Then in your app delegate, create your split view controller with both view controllers: self.splitViewController.viewControllers = @[chapterNavigationController, pageNavigationController];
Then make sure to set the rootViewController to your splitViewController:
self.window.rootViewController = self.splitViewController;
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