RayofHope
RayofHope

Reputation: 1187

iPhone - iPhone5 support to existing app?

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.

Upvotes: 0

Views: 380

Answers (5)

RayofHope
RayofHope

Reputation: 1187

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 

Upvotes: 0

Begeesy
Begeesy

Reputation: 101

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;

Upvotes: 1

Chris
Chris

Reputation: 811

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/

Upvotes: 1

Simon
Simon

Reputation: 9021

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.

Upvotes: 0

Sebastian Flückiger
Sebastian Flückiger

Reputation: 5555

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

Upvotes: 0

Related Questions