iphone 3.5 and 4 issue - iphone

i was making an application is ios6 but i have to make it compatible for ios5 too. i made weak link to the libraries and they are working fine but one issue arises and i still not solve it. the problem is regarding iphone 5 and iphone 4 sizes. i had some questions:
in view under xib what i should pick view size iphone 3.5 or iphone 4?
if i place in buttons and other controls according to 4 size than they goes out when i run it on iphone 4 and vice versa?
should i need to make two xibs to overcome it?
or is there any other method which will resize my view and make it compatible for iphone 4 and 5?
EDIT
iam making application on ios6 and i want my application to run on both iphone 4 and 5.
thanks .

Generally you don't have to worry about this because iOS can move your controls around for you using either:
Auto sizing: If supporting iOS versions prior to 6, use the auto sizing masks (sometimes affectionately called "springs and struts", and when accessing programmatically, it's called the autoresizingMask) so that everything moves arounds appropriately. So select the "size inspector" and adjust the "autosizing" masks:
Autolayout: If you're developing an iOS 6 and above app, you can also use the new the "autolayout". See Cocoa Auto Layout Guide which has tons of relevant links. Also see the Xcode 4 Users Guide.
Turn autolayout on and off: If you want to develop an iOS 4/5 compatible app, you may need to turn off "autolayout". If so, go to Interface Builder, click somewhere on the background, select the "file inspector" in the right panel, and examine/change the "Use Autolayout" flag.
I'd suggest designing for the 3.5" screen. And let it resize or move your controls for the 4" screen.

Related

Make a iphone 3 app fit the iphone 5 4-inch screen

I have a Xcode project for a iphone app that has been designed to be universal and has a deployment target of 4.3. The project uses a .xib file for constructing the user interface and I am only familiar with storyboards. My goal is to make the app that only works on the 3.5 screen fit the iphone 5 4-inch screen. Do you guys have any tutorials online or tips on how I can do this? Thanks in advance!
The process is pretty simple:
Make sure you have a Default-568h#2x.png default image. See App Launch (Default) Images in the iOS App Programming Guide for information about these default images, sizes, etc. But by adding this default image, that informs iOS that your app supports the 4" screen.
When designing your NIBs, you can toggle the simulated metrics between 4" and 3.5" to see how the view is rendered for both:
You can then adjust your autosizing masks for your various controls so they resize correctly. This is an example where the margins are all fixed and it should grow as you go to 4" screen:
"All" you have to do is properly set the struts-and-springs "autoresizing masks" in Interface Builder. The same as you'd do for Storyboards.
A friendly tip while at it: don't do storyboards except for the simplest of apps, and don't use auto layout before you're familiar with struts-and-springs and are absolutely sure you can't use struts-and-springs to do your work.
Turn off auto layout in new .xibs here:
Of course, if you have device-specific artwork (such as a background that's exactly 960x640), you'll have to do more work than that, but you're prepared for that piece of the puzzle, right?
Next, add a Default-568h#2x.png file to your project. Make it 1136x640, or if you're not covering the status bar area, make it 1096x640.

How to make iPhone4 and below version app compatible for iPhone5?

I have an application in iphone market which works for iPhone 4s and lower version. So now iPhone 5 has been launched which bigger size screen, my question is what all changes i have to do in my application so that it will be compatible with iPhone 5 also.
1) Do i have to rebuild my app for iPhone 5?
2) Do i have to make changes only in UI ?
3) Will the iPhone 5 will its make it compatible?
Your valuable replies will help me a lot. Thanks in advance.
Here is my answers,
1) Do i have to rebuild my app for iPhone 5?
If you want to utilize the complete screen space, you can add Default-568h#2x.png and rebuild the app and release it.
2) Do i have to make changes only in UI ?
You can utilize the complete screen space for iphone 5. You can code for screen modifications in case of other iPhones.
3) Will the iPhone 5 will its make it compatible?
Yes. It will make it automatically compatible. It will add a black strip on top and bottom to compensate for the extra space in the screen unless you add Default-568h#2x.png.
If your app uses the standard UIKit provided by Apple, you only need to add a 4 inch launch image to your app, and it will automatically resized itself. But if your app using custom controls or graphics-heavy like in games, you might want to adjust the images and take advantage of the larger screen.
You also have to make sure the methods you used do not deprecated on iOS6 to prevent the app from crashing. Some references if you need further reading.
To make older app compatible with iPhone 5 You need to look for Following things.
Latest Xcode version 4.5.
Open your project and select Upgrade settings for new version.
Add Default-568h#2x.png for new resolution .
For UI you have to change your xib's object autoresizing property.When you select View Go to
inspector and select size property It will show you None, Full Screen, Retina 4 options . Set autoresize property for all your Buttons , labels and check xib for retina 4 and None both.It is same like you set it for Landscape and portrait .
5.Some other changed will be in code because some method has been depreciated for ios 6.0.
6. After doing all this .You can run it on iphone 5 simulator for testing.
I have an app that was using GLKMatrix3 and its supporting functions. I found that the GLKMatrix3Multiply function would always crash on iPhone 5 hardware. Easy to workaround using GLKMatrix4 instead, but the point is that I would never have found the problem without actually trying my app on iPhone 5 hardware.
I was told to file a bug for the GLKMatrix3 problem, so maybe this will be fixed. But the code runs just fine in the iOS 6 simulator.
I learned from this that, whether or not you need to rebuild your app for iPhone 5, you do need to at least run your app on a device before advertising support for that device.

Adjust iPhone 5 Screen Size Without Using Autolayout

Enabling Autolayout in .xib or .storyboard and adding a splash screen of 640px by 1136px enables iPhone 5 resolution support for the taller screen.
However, doing so, my app started to display some funny things where I assume autolayout is not a great idea.
I am wondering if there is a way to enable iPhone 5 device support, i.e. fix app's resolution without using Autolayout? Maybe I can set in the code?
If yes, then I will have no need to create 2 storyboards or nibs to support iOS5- and iOS6.
If you weren't using Autolayout before, you won't need to use it for iPhone 5 support.
When you're putting your interface together, you just need to check your bindings, and toggle between the taller phone size, and the regular phone size, as described here:
Xcode Storyboard displaying the new iPhone 5 screen size?
If your screens look fine in both screen sizes then you're done.
If you are doing a lot of coding to show your UI, then you'll have more work to do.
I found a great answer a couple weeks ago (link below). You will copy and paste your older iPhone Storyboard, rename it to reflect the iPhone 5, and press the button that expands the screen size, found on the bottom of the layout grid. Some minor coding adjustments might be needed, but this sample code is used in the AppDelegate to detect which device is running, and hence, which Storyboard to use. You'll just have to duplicate your interfaces, but these GUI changes can be made without code and without AutoLayout (also good to note that AutoLayout removes iOS 5--and lower--compatibility)
xcode 4.5 how to pick storyboards at launch

iPhone 5 Applications (4 inch Screen) [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to develop or migrate apps for iPhone 5 screen resolution?
I'm (still) trying to convert one of my iPhone applications to iPhone 5, but it still looks like this in the simulator...
What am i doing and why won't it fill up the entire screen?
Have you provided a 4" sized launch image? That's the indicator that tells the OS that your application supports the full screen.
Have you selected in your UIView attributes inspector in XCode iPhone 5 screen size?
Please have a look at the url,
iPhone 5 TabBar not functioning in proper position
Now, in xib, at the right side, under 'Interface Builder Document', put a tick-mark on use autolayout and fix your objects in xib accordinlgy.
Download and install Xcode 4.5 GM. Set a 4-inch launch image for
your app. This is how you get 1136px screen height (without it, you
will get 960px with black margins on top and bottom).
Test your app, and hopefully do nothing else, since everything should work magically if you had set auto resizing masks properly. If you didn't, adjust your view layouts with proper auto resizing masks or look into Auto Layout if you only want to support iOS 6 going forward.
Also note: The auto-rotation API has changed completely, take a look at that as well if your application supports any rotation other than default.

How does a UIStoryBoard change on iphone 5

I have an already shipped app on App Store that made use of Storyboard.
I see from the keynote, comparing to previous model that iPhone 5 has a taller screen.
I wonder how this will impact on my esisting storyboard, because from my 'app point of view' there's only one difference which is the background.png. All the rest is just plain UITableView that can just fit more rows.
I cannot find any document for this on Apple site (I have always been so noob in finding things on Apple developer site).
Has anyone made adjustment to his already developed and published app to match with new layout ?
If yes, do I have to develop a brand new storyboard, or is there an adjustment to be done with code ?
[UPDATE]
I am reporting my experience, now that Xcode 4.5 is long shipped for development.
Xcode itself, as some suggested, asked me if I would like to enable tallest screen support by creating a default png. After saying yes, I had to enter each segue in storyboard for some adjustment, change png background (which was unstrechable by design) with a tallest one, change stretching settings and redeploy.
It has been an annoying work because I have quite some segues, and Xcode doesn't allow to reuse templates within Interface Builder.
Old apps without 1136x640 resolution support will run letterboxed, with black areas on top and bottom.
You can enable new layout support for existing project simply by supplying new Default-568h#2x.png loading screen. Take heed though, you'll have to test your old interface on both old and new resolution (via iOS Simulator) to make sure everything looks good and works as designed.
Its been said when iphone 5 is launched that your app view will be filled with black color on top and bottom if it is not taking account for the increase size ( not designed for iphone5 screen)
so your app will just work fine but will have black border on both and top to filled the extra space..