Ios – Converting Storyboard from iPhone to iPad

iosipadiphonestoryboardxcode

I have an iPhone application which has a storyboard. Now I want to provide an iPad application too. So I asked me whether there is a function which helps me convert my iPhone storyboard to an iPad storyboard.

To be specific:

Is there a similar function or is there only the manual way ?

Best Answer

I found out a kind of solution:

  1. Duplicate your iPhone-Storyboard and rename it MainStoryboard_iPad.storyboard

  2. Close Xcode and then open this file any text editor.

  3. Search for targetRuntime="iOS.CocoaTouch"and change it to targetRuntime="iOS.CocoaTouch.iPad"

  4. Change the code in the MainStoryboard_iPad.storyboard from:

    <simulatedScreenMetrics key="destination" type="retina4"/> to

    <simulatedScreenMetrics key="destination"/>

  5. Now save everything and reopen Xcode. The iPad-Storyboard has the same contents as the iPhone-file but everyting could be disarranged.

This saved me hours - hopefully this will help you