iPhone - iPhone5 support to existing app?
Asked Answered
A

5

0

Should i have to place a separate xib Like 1 for iPhone5 and 1 for iPhone4 and lesser Doing this way seems very bad practice. Can any one have idea about it? Also iPhone5 Using Autolayout? i am not getting how Autolayout works.

Adopt answered 22/10, 2012 at 7:25 Comment(2)
raywenderlich.com/20881/beginning-auto-layout-part-1-of-2Sandhurst
#12703046Lukasz
B
1

Watch the WWDC 2012 Videos on the subject. There are three 1 hour videos that taught me all I needed to know in order to migrate my apps to Auto-Layout.

https://developer.apple.com/videos/wwdc/2012/

Benempt answered 22/10, 2012 at 8:14 Comment(0)
B
1

If your main issue is the new screen size make sure to add [email protected]. This 640 × 1136 image is needed for your app to utilize the iPhone 5's full screen.

Also use

[[UIScreen mainScreen] applicationFrame]

to get the current screen's width and height. Do not hard code 320 width 480 height.

CGRect aFrame = [[UIScreen mainScreen] applicationFrame]; width=aFrame.size.width; height=aFrame.size.height;

Bluebird answered 22/10, 2012 at 9:18 Comment(2)
This makes sense, but as I said above, don't you think apple will create something easier?Adopt
Easier? Thats easy enough Ray. Ray its always better to make your code smarter to overcome simple obstacles such as this. Don't depend on apple making it easier. Will appreciate a 1 or a check Ray.Bluebird
Y
0

seperate xib files: yes, is one of the possible ways.

autolayout: http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2

(google first hit).

Yardarm answered 22/10, 2012 at 7:27 Comment(0)
H
0

I modified my apps to include autolayout. In all honesty, if I'd have been more proactive I would have designed them with new screen sizes in mind at the start - a mistake I won't make again!

How you approach it really depends on how you designed your original application.

Hunk answered 22/10, 2012 at 7:45 Comment(0)
A
0

I found and will help others also: https://github.com/mindsnacks/UIImage-MSImageNamed568hSupport

using this we can load 568h size image for iPhone5 if present o.w. load normal image great help...

Example:

#import "UIImage+MSImageNamed568hSupport.h"
.
.
IBimgViewBG.image=[UIImage ms_imageNamed568hSupport:[NSString stringWithFormat:@"sample.png"]];
.
.

Note: include this images in your project

sample.png      // for earlier versions
sample-568h.png // for iphone5 
Adopt answered 23/10, 2012 at 7:3 Comment(1)
Dude, you are basically doing the same thing I showed you below. The first two lines of code are "const CGSize screenSize = [UIScreen mainScreen].bounds.size; const CGFloat screenHeight = MAX(screenSize.width, screenSize.height);" Could of gave me a 1 :(Bluebird

© 2022 - 2024 — McMap. All rights reserved.