Very common question and I have run into this issue with every single app of mine.
You have two options
- In your story board you can have two branches from a single welcome screen viewcontroller. One brach will have all controller of 4in size while the other will have 3.5in controller. Draw back to this way is that you are creating double the work for yourself in storyboard.
This is how you do it
- Create layout as shown
- Add two buttons and attach them modally to those views.
- Change storyboard Segue identifiers to "iphone4" and "iphone5" for each button.
- Make the buttons really really small of 1px / 1px and hide them. Remove any default text.
- Add this code
in your *.h
#import <UIKit/UIKit.h>
@interface v2ViewController : UIViewController
{
NSTimer *timer1;
NSTimer *timer2;
}
@property (nonatomic, retain) NSTimer *timer1;
@property (nonatomic, retain) NSTimer *timer2;
In your *.m add this
@synthesize timer1;
@synthesize timer2;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
timer2 = [NSTimer scheduledTimerWithTimeInterval:2.5 target:self selector:@selector(moveOn) userInfo:nil repeats:NO];
}
- (IBAction) moveOn
{
//Now go to the Display Call Page
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
// iPhone Classic
[self performSegueWithIdentifier:@"iphone4" sender:nil];
}
if(result.height == 568)
{
// iPhone 5
[self performSegueWithIdentifier:@"iphone5" sender:nil];
}
}
}
- Second option is to add code that will resize all the views, buttons etc accordingly. You will need to attach everything to an IBOutLet and then do this. (sorry but I don't know why the #@!$ code formatting isn't working)
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
// iPhone Classic
[weatherBGImageVw setFrame:CGRectMake(0, 0, 320, 480)];
}
if(result.height == 568)
{
// iPhone 5
[weatherBGImageVw setFrame:CGRectMake(0, 0, 320, 568)];
}
}