10

Is it okay to use different storyboards for different screensizes? I just can't make my png and icons images work for one storyboard as universal, it's a pain!

What about universal iPhone and universal for iPad? What's the best way?

Thanks

masaldana2
  • 635
  • 9
  • 20
  • 1
    Think about your app running on an iPad in multitasking mode. Now rethink if having device specific storyboards is a good idea. – rmaddy Dec 21 '16 at 22:19

2 Answers2

14

You can also use one storyboard and set layout and font according to your requirements.

1) To set up layout properly for both iPhone and iPad, you need to use Aspect Ratio. You can check the answer in detail following these two links:

1) What constraints should be given to increase size of imageview with respect to device screen size without reducing image clarity

2) Calculating Aspect Ratio for all sizes of iphone - It will work for both iPhone and iPad.


2) To set different font size for iPhone and iPad, there is a setting in your storyboard, check the image.

there is the + symbol near your Label. For iPad, you need to set Regular height and regular width. And for iPhone it will take regular font size. (AnyHeight , AnyWidth).

Check the screenshots for better understanding.

enter image description here

enter image description here

Output :-

enter image description here

As a conclusion, you don't need to take different storyboards for iPhone and iPad. I hope this answer will help you.

Badal Shah
  • 7,541
  • 2
  • 30
  • 65
  • so how would you go about resize an array of pngs (16 pngs) it gets very messy using your approach? i tried stackviews but that doesn work – masaldana2 Dec 23 '16 at 03:26
  • aray of pngs ? stackviews ? can you please explain bit more in detail ? there is 1x , 2x, and 3x assets available. iphone and ipad will select it automatically according to device screen size and resolution . – Badal Shah Dec 23 '16 at 06:05
1

Although you can use multiple storyboards for multiple screens it usually isn't necessary if the layout is similar enough. Note at the bottom of the attributes inspector in the interface builder there is a box called installed. You can use this to specify what constraints go where. Add the ones you want to the devices you want and remove them from the others.

Andrew McKinley
  • 1,137
  • 1
  • 6
  • 11
  • so can i make two universal storyboards? one for iphone and the other one for ipad? or just one to rule them all? – masaldana2 Dec 21 '16 at 22:33
  • I would recommend one universal storyboard. If iPad and iPhone are drastically different then one for iPhone and one for iPad. – Andrew McKinley Dec 22 '16 at 15:40