0
votes

I have a UINavigationController which loads a table view. Cells push detail view controllers onto the screen. Now my app is becoming universal and I feel stuck with how to go about using a UISplitViewController on iPad.

What is the Apple-recommended way to implement a UISplitViewController for a iPhone UINavigationController on iPad? How does the code know it should load the UISplitViewController on iPad but ignore it on iPhone?

This is what I found in a guide:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
     // The device is an iPad running iOS 3.2 or later.
}
else {
     // The device is an iPhone or iPod touch.
}

But, is it really the way to conditionally load iPad UI vs. iPhone UI? I don't use IB or Nibs.

1
This link maybe helpful. hereEzimet

1 Answers

0
votes

Since iOS8, you are very recommended to use a split view controller in both cases. The system will worry for you how to behave on compact devices (so it will push the detail view controller instead of displaying it in the split view controller).

This functionality is only for iOS8. If you need to support older operating systems, you need to split your views into multiple storyboards or XIB files, and in runtime query the user interface idiom and decide which to load, and how to perform specific tasks.