I am trying to create a universal app capable for all devices, but it is not scaling correctly. Below (the correct version) is a screenshot of my iPhone 5s, and the one that is out of scale is a screenshot of my iPad 2.
Am I doing it correctly making it scale? Or should I use 2 storyboards and assign one to iPhone, and one to iPad?
Its good to make two different xib. But for small screen you have to apply proper auto sizing then it will not be a problem. You can use this for example
For Section 1:
For Section 2:
For Section 3:
and
For Section 4&5:
The better way of doing this is making two separate storyboards. One for iPhone and other for iPad. This offers you the flexibility to play with both in your own ways and there are many cool things that you can work out with iPads. And to do that, you need separate storyboards in your app. It eliminates the dependency between the look and feel of both the devices.
For making two storyboards the easy way, see this :
How/whether to make a universal storyboard in Xcode
For the selection of appropriate storyboards based on devices, check this :
Selecting different storyboards based on device type
This might help you immensely.
Related
I'm working on an iOS app, that should work fine with both iphones and ipads.
As I know we can build the app as universal or convert iphone storyboard into ipad storyboard.What I want to know is, what is the best way from these and, when we launch app to app store, is it a problem to have two storyboards one for iphone and another for ipad.
What I want to know is, what is the best way
That depends on your needs. Do you want the interface to be the same on iPhone and iPad, except sized differently? Then you may be able to use a single storyboard and rely on autolayout to adapt to different devices. If you want different interfaces on iPhone and iPad, perhaps to take better advantage of a much larger screen, then use different storyboards for each device type. You should still use autolayout in each storyboard, though, because within each device type there are several different screen sizes.
is it a problem to have two storyboards one for iphone and another for iPad
No.
Two storyboards for each type of device is a best way. As a result you will have more usable and careful UX for both types. But this way require a little bit more time for developing.
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.
Hey there i want to make my app look different on other iPhones so i want to make storyboards for every iDevices is it possible ??
(Without Auto-Layout) Thanks
Yes it is possible to create storyboards for every device that you want. However it is very tedious as compared to having 1 universal storyboard or two storyboards if you want different designs for iPad and iPhone.
Alternatively, you could also use code to detect whether it is an iPad or iPhone, check out this link. As for different sizes for the iPhone, you can do a manual check of the size of the scene and adjust accord.
I am trying to find answer, That Since we have iPhone 4, 5 ,6, 6 plus (I heard some rumors about iPhone 6 mini too) do we need Different Storyboards?
Earlier I use to make the Applications using XIB files only. Taking one XIB for iPhone 4 and 5 and using autoresizing to make them Compatible for both devices. If I had to make the same application for iPad also, I had to take the different XIB.
After Xcode 6.1 release I started using the StoryBoards and auto-layout, Size Classes. I made an app that was for all iPhones and iPad. I used a single Storyboard for iPhone and iPad and got success. But doing this was very time consuming.
From now on Should I make different Storyboards? Like one for iPhone 4 and 5, another one for iPhone 6 and 6 plus? Because Some time the UI's are too complex that using auto-layout or auto-resizing on the same Storyboard for all devices just destroy the beauty of the UI.
Please Suggest. And I have gone through some Stack answers that are not much Convincing.
In my opinion, different storyboards for iPhone/iPad is necessary only if you gonna provide large different layout for them.
The basic rule is how many views have different layout? Totally or just few views?
If the answer is 2 of 30 or kind of that, make a second viewcontrollews layout with same "custom class" but different "Story ID" is enough.
The answer to your question is: No, we do not need separate storyboards. The answer to your question of whether you should make different storyboards is not so simple.
Basically it is a decision you will make based on your judgement. There is no correct answer. I'd suggest you start with one and if things start getting messy, create a second one. Just don't make the first storyboard too big before you decide if you need to split it out into two or not. It really depends on how different your designs are.
There is possible to add storyboard for any screen size?
Example if the iPhone is 6 plus load storyboard 1 if is iPhone 5 load storyboard 2.
Yes it's possible, although I would not recommend it. In fact I would strongly recommend against it.
It is a lot more work to develop in the first place, is a lot more error-prone, and is also a lot more work to test and maintain, and makes it possible to have platform-specific bugs when you have different configurations for each screen size.
With the size classes added in iOS 8 Apple has made dealing with different sized displays easier and cleaner. They are pushing developers away from separate storyboards for iPhone and iPad and towards a single storyboard that manages all platforms.
Try having one storyboard with a universal path then splitting the path using segues based on the phone you are using. I made a cocoapod for screen sizes that might be useful for you.
Here's a tutorial