0

I've already created and finished the iPhone version of my app, and before I submit it want to create the iPad version in the same file.

I've used storyboards, so would I have to create a whole new storyboard for the iPad side of it, then link the same code, and then somehow tell the app to run one of the storyboards at runtime? That seems to be what I've extracted from the internet). Can someone explain?

I tried laying out the following in the appdelegate.m

    UIDevice* thisDevice = [UIDevice currentDevice];
if(thisDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad)
{
    // iPad


}
else
{
    // iPhone

}

but don't know where to go from here.

jscs
  • 63,694
  • 13
  • 151
  • 195
Shi Diun
  • 1
  • 5
  • First thing to do is to enable iPad in the project settings. – Hot Licks Feb 24 '14 at 00:47
  • You read 13 tutorials, and all you managed to get out of them was `if (thisDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) `??? – nhgrif Feb 24 '14 at 00:54
  • repost of [How to make a universal iOS app? (iPhone and iPad w/ Storyboards)?](http://stackoverflow.com/questions/21976558/how-to-make-a-universal-ios-app-iphone-and-ipad-w-storyboards) – jscs Feb 24 '14 at 02:07

2 Answers2

0

It should be straight forward, in XCode create a different storyboard for your iPad.

Place your UIcomponents on your View, and connect them to the same ViewController.

Both iPhone and iPad will be sharing the same code logic, only difference would be the storyboards.

meda
  • 45,103
  • 14
  • 92
  • 122
0

First, tell xCode your app is universal (on your target's general configuration). Then, you need 2 storyboards on your project, lets say Main_iPhone.storyboard and Main_iPad.storyboard. on the same screen, set the Main Interface for each case to the corresponding storyboard.

Also, make sure that your application:didFinishLaunchingWithOptions is not setting any root view controllers. To test this, make this method return YES without doing anything else.

Hope this helps.

amcastror
  • 528
  • 5
  • 15