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 ?
I followed this thread when I was hit with the same issue yesterday. The steps I followed
targetRuntime="iOS.CocoaTouch"
totargetRuntime="iOS.CocoaTouch.iPad"
<simulatedScreenMetrics key="destination" type="retina4"/>
to<simulatedScreenMetrics key="destination"/>
That was it.. Thanks all for your help..
From reading many threads on stackoverflow i discovered the solution is-
1.Duplicate your iPhone-Storyboard and rename it MainStoryboard_iPad.storyboard
2.right click on the storyboard -> “open as” -> “Source Code”.
3.Search for targetRuntime="iOS.CocoaTouch"and change it to targetRuntime="iOS.CocoaTouch.iPad"
5.Search for
<simulatedScreenMetrics key="destination" type="retina4"/>
and change it to to<simulatedScreenMetrics key="destination"/>
4.Now save everything and right click on MainStoryboard_iPad.storyboard “open as” ->"IOS StoryBoard" 5. you may also have to change your constraints. Thats all you have done.
There is a really simple solution for Xcode versions that support size classes (Tested in Xcode 7 which is the current version at the time of writing). Check the "use size classes" checkbox on a storyboard file (File Inspector), confirm that dialog that appears. Then uncheck that same checkbox - Xcode will ask you if you want to use this storyboard with an iPhone or iPad, and convert the screens in it appropriately. No need to directly edit the storyboard file. For both iPad and iPhone, just copy the same storyboard and configure one for iPad and one for iPhone using the described method.
And Before someone suggest to use size classes - while great, they are less convenient for heavily customized UI, such as games etc