1
votes

I have an iPad only app that I'm switching to support iPhone as well. Not going well so far, the project was created before universal storyboards. When I run it on the iPhone, it sticks with the good ol' iPad size. Should I delete my storyboard and add a Universal one, or create separate Xib's / Storyboard's to support iPhone's?

2

2 Answers

1
votes

You can use a second storyboard but in my opinion it is easier to generate all the objects in code. Then you can use values like this: self.view.frame.size.width/2 to center it on the x-axis on every device. And you don't need a storyboard for every screen size.

1
votes

I don't think you need to create separate xib or storyboard to support iPhone.

You can enable auto layout and size classes in your storyboard. Auto layout helps you layout your views based on constraints while size classes helps you check whether the view is running in iPad or iPhone, as well as the device orientation.

You can then layout your screens based on different size classes.

Please check WWDC video Building Adaptive Apps with UIKit for more information.

Check these two ticks