porting iPad app to iPhone using one storyboard with one storyboard - ios

i am able to make my iPad app running on iPhone but the iPhone screens doesnt fit all the content in. For example my table view main text is hidden, the buttons are very much spaced from the border. I understand the spacing given in my storyboard files in too big for iPhone screen.
I want to make my app work for iPhone with very minimal changes. I dont want to create a new storyboard and rewrite everything. Please suggest a good way.
Thanks in advance.

You need to make the app Universal, make a single storyboard the main storyboard in both target's project settings and use Autolayout to position your UI elements respective of the device. Look into Size classes to keep your design responsive.

Related

is it possible to design view for iPad without autolayout?

I have developed app without autolayout for iPhone. Now I need that app for iPad also. Is it possible to create it without autolayout?
yes, you have to create App directly then select iPad.
and using Auto Resize ,you can directly develop app for iPad only.
I have attached few Screen shot, may be helpful to you.
Create new project, using XIB .
I don't recommend that (see comment of #Nimit Parekh).
You can use Sized classes to avoid having 2 separate Storyboards - one for iPhone and other for iPad. There is a good tutorial.
Second option is to have 2 storyboards. You only need to link all outlets from the 1st storyboard to the second. You have to check not to miss something, otherwise you can get exceptions in iPad.
The 3rd option is manually (from the code) to manage layout for iPad - but this will create a lot of specific code for iPad only (you have to check what type is your device and split code) - this is not recommended.
Take into account that Autolayout is more easy to apply on iPad (from my point of view) because of equal withd / height ratio for iPad - it is the same up to now. Not like in iPhone.

Do I still need two Storyboard files to manage different devices now with Universal Storyboards?

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?
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.
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.

iOS storyboard layout

I am working on an app and have come into some graphical problems when designing my app.
First off, my app is only support by iPhone. My current storyboard is using the iPhone 5 as the screen size, so everything screws up when I try to run in iPhone 4 and 4S. Is there a way to make multiple storyboards for each different screen size? Or do you all have another solution?
Thanks!
- Brad
There is a way to make different storyboards for separate screen sizes, but another way to do it is like this:
Whenever you add objects to your views, be sure to have them aligned to something (using constraints). If all items are relative to other items, then most likely the layout will be fine on all devices. Also, if you find that your controls start overlapping, then perhaps you ran out of room. In that case simply add a scroll view to your layout, and then put the controls on top of it. Then, it won't scroll on the larger screens because all controls are shown, but on smaller devices it will allow you to scroll down to see the rest of the objects.
Good luck.
There is a small button in the lower right hand corner that lets you toggle between 3.5" and 4" screen sizes so you can see how it will look on different devices. By using Auto Layout introduced in iOS 6 you can make sure to set up your constraints so that your UI looks good on both older and newer iPhones.

ios - how do I make an app which I developed on the iPhone storyboard also work on the iPad?

I have an app that is nearing completion. So far I have just been using the iPhone storyboard to map out the navigation, but I would also like the app to work on the iPad. Is there a way to just "make it work" or do I have to re-do by hand the entire app flow on the iPad's storyboard?
Thanks!
Considering they have different resolutions, and aspect ratios, you really just have to grin and bear it, and convert it all manually. You can at least copy the storyboard file to a new one, and adjust the views one by one to be ipad-sized
If you made it a universal app, I'd suggest creating another storyboard targeted for iPad and work from scratch. You can still use all the controllers and methods therein for your new views (considering there's nothing very specific) with some slight modifications to adjust for the iPad.

converting story board from iphone to ipad

I have a storyboard for my iphone version of my app and I want to have the same storyboard for my ipad version (only bigger). My story board only has text and buttons is there anyway I can just convert the whole thing and increase the size by 2, or do have to resize everything manually?
You really need to do more than just resize you know. iPad users don't generally enjoy running iPhone apps at double size on the iPad and it sounds like that's what you're proposing to do.
In your storyboard you can drag and drop from your iPhone screens to iPad to get all of the elements into the iPad storyboard. Then maybe you will tweak a bit to make it more iPad friendly.
As far as I know, you will need to create a new storyboard and set that as the storyboard for iPad (app settings). You will then need to create the content manually (you can copy and paste the objects and use the existing controller classes though (will need to wire up the objects).

Resources