I'm trying to make my first iOS app in xcode 7 for iOS 9
and i want to make it for all the iphone devices like iphone 4,4s,5,5s,6.
Do i have to make a different xib file for each one of the iphone or there is a simple way to make it for EVERY iOS device also like iPad???
There's a magical thing called autolayout. And another thing called universal app
You Can do both in single storyboard first you have to choose Universal while creating project. You need to do autoresize or apply auto layout.
No, you shouldn't need to do device or resolution detection. iOS includes lots of features for adaptive user interfaces. See here for example: https://developer.apple.com/design/adaptivity/
You just use auto layout concept in your application and you will find lots of document on net for auto layout and re sizing class.
You can make one app for all device using autolayout and make your app universal and in xcode 7 and ios 9 there is new feature available stack view using this you can do this.
Related
Does the application get auto resized when uploaded to the AppStore to fit all devices like iPhone 5 and iPhone 7+ ?
I'm asking this because I'm about to release a new app for the Appstore but in the simulator and on a real device the application doesn't gets resized and all the buttons and label etc are not where they should be.
I am also developing an iOS app, so I understand your problem.
The application doesn't get resized.
The buttons/labels won't be put wherever they should be as Xcode doesn't know where to put them. This is because the screen size varies with each device.
You should use constraints (really good tutorial) to put your buttons/labels wherever you want them to be. Another good tutorial
It's not automatic. You need to design your app to handle layouts on different devices. It's a rather complex subject. You'll need to learn about AutoLayout and size classes, among other topics. If your app isn't handling this correctly, it's not ready for the app store.
Firstly check your application is universal application .
Then You need to look at your Auto Layout constraints inside your storyboard.
Understanding Auto Layout
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.
I developing an iPad application to support landscape only. I have chosen the size classes with Regular Width and Regular Height size. Whenever placing UIView or UI elements and run in the device, It works fine in the IOS 8 but it wont display in the IOS 7. seems looks like size class compatabile issue. Can anyone share your thoughts about how to resolve these UIview to display even in the IOS 7.
Thanks In Advance!!
iOS 7 Does not support size classes. I had this issue and I resolved it by forcing iOS 8 compatibility.
Unfortunately I think your best bet (which is kind of terrible) would be to branch your code and make two separate storyboards one for iOS7 and one for iOS8. That being said, given you are only supporting iPad min and iPad normal, you could do two separate storyboards depending on which device it is.
I know neither of these 3 options is ideal but thus is the cost of backwards compatibility.
Summary:
punt on iOS7
develop an iOS7 specific version and an iOS8 version
develop a separate storyboard for iPad mini and iPad Normal
I've been developing iOS apps for the past 3 years and learned to do so without the use of nibs and storyboards. With the release of iOS 8 and the new iPhones there are ALOT of factors to take into account when developing for iPhone and even iPad devices (Resolution, Screen size, etc.).
The first problem I ran into with Xcode 6 is you can't create a empty project anymore. The closest option is a single view application. I found the following answer here.
Now it seems that apple is really pushing auto-layout, the use of the size classes and the use of storyboards and Interface builder. Is there any way to support the native resolutions of the iPhone 5, 6 and 6 plus and do this programmatically? The only option I can see is defining the frame of each UI element for each device which will lead to a ton of code.
Auto layout IS programmatic. Apple has given the necessary API's to handle size classes entirely in code if you don't want to use interface builder or storyboards and there has always been ways of adding constraints in code too.
You might think IB is a silly tool for noob developers or is only for basic apps and you need more power or whatever your reason, but maybe trying to do every thing yourself in code is a bet you have now lost. Give tools a try.
It's referred to as VFL or Visual Format Language.
VFL Tutorial
I am new in development for iOS/OSX in xcode. I am doing app for iOS in xcode 6 GM. And how can I add new elements like(UIButton,UITextField) but I wanna that these elements are in same position for every resultion (iphone 4 to iphone 6 plus). How can I do it? It is possible or I must code for every resulution different possition?
Thank you for replies.
Look into auto layout. That will solve a lot of your issues.
If you are like me, and don't like using auto layout, you can download my file in the link, and create multiple storyboards and with the names of Main, iPhone5, iPhone6, iPhone6Plus, and in the AppDelegate.swift you would put the code in to call for those story boards for the respectful device.
https://www.dropbox.com/s/3o0qhxcqx0yekax/ScreenSizes.zip?dl=0