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 ?
For Xcode10
Just duplicate
Main.storyboard
Then re-name files to
Main_iPad.storyboard
andMain_iPone.storyboard
Set appropriate names in
.plist
4.Just select the proper .storyboard to configure
You should create a bug report with Apple. You can say it's a duplicate of mine (10167030) which has been open since September 2011. The frustrating thing from my point of view is that the feature existed in Xcode 3...
This functionality is now built-in. For example, if one changes the project settings in Deployment Info -> Devices from iPhone to Universal, the following dialog will show up:
A Different Approach
Add an empty-View-Controller with Navigation-Controller in the iPad-Storyboard
Change the Class to the Class of your first ViewController used for iPhone, "fooViewController"
Add the Storyboard-Identifier in the iPhone-Storyboard "fooViewController_storyboard_identifier" for the first ViewController
Go to "fooViewController.m"
Add bool Variable bool
nibWasLoadForIpad=false
Go to
viewDidLoad
-Method(ps. Know problem is that the view-backgrounds will be set to white)
The easiest and most reliable way to do this is to copy paste from your iPad storyboard.
You'll have to go about resizing, but it can be faster than recreating the whole storyboard.
That didn't quite work for me. I did something a little bit different.
<scenes> <!--Contents View Controller-->
</class> </classes>
That worked for me. I got a new layoutout with all my outlets connected, which alone saved me a few hours.