Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making two storyboards for iOS (iPhone and iPad)

Is it possible to make only one application and inside of it make two storyboards, one for iPhone and one for iPad? I don't like the idea of running the app on iPad and clicking the 2x button.

My idea was to create two storyboards and have a beginning class that would check if the device you are using is an iPhone or an iPad and then redirect to the according storyboard after. I think it is a good idea cause the code is the same.

like image 789
Cartman Avatar asked Nov 28 '12 20:11

Cartman


People also ask

How do I make different layouts for iPad and iPhone?

1) You can use Autolayout constraints and size classes to make the view compatible to both iPhone and iPad screen sizes. 2) You can create and use separate Storyboards or . Xibs each for iPhone and iPad and use accordingly.

How do I make multiple storyboards in Xcode?

Create storyboards by File -> New -> File -> Select Storyboard -> Next -> Give it a name -> Create.

What are iOS storyboards?

A storyboard is a visual representation of the user interface of an iOS application, showing screens of content and the connections between those screens.

How do you edit storyboard on iPhone?

In Xcode 9.2, simply go to your Storyboard and go to the bottom, Click View As and choose a device you like.


2 Answers

create two different storyboards and name them so they are easily specified which is which. Then click on the file that allows you to change settings for your actual app. and change the build to universal, then specify which storyboard you want to use!

there is a storyboard setting for iphone and ipad

iPhone

enter image description here

iPad

enter image description here

Make sure the names of the storyboards are correctly set though

like image 121
Bad_APPZ Avatar answered Sep 27 '22 20:09

Bad_APPZ


Even if you already made an app non universal, just change it to universal (target-->summary), then create a new ipad story board and make sure under target-->summary that the main iphone storyboard and main ipad storyboard are set to the right storyboards.

like image 32
user1858163 Avatar answered Sep 27 '22 21:09

user1858163