Possible Duplicate:
How to detect iPhone 5 (widescreen devices)?
I am trying to add a new view to an existing ios4 project to handle the new iphone5 screen size.
However I dont have an iphone here to test on and the code I am using to test the screen size isnt working, just wondering if there is another way of detecting the device type??
NSLog(@"%f", [ [ UIScreen mainScreen ] bounds ].size.height);
if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){
if([UIScreen mainScreen].bounds.size.height == 568.0)
{
//move to your iphone5 storyboard
[self changeView:splashScreenBIGV viewH:splashScreenH animLength:SCREEN_CHANGE_ANIM_LENGTH];
}
else{
//move to your iphone4s storyboard
[self changeView:splashScreenV viewH:splashScreenH animLength:SCREEN_CHANGE_ANIM_LENGTH];
}
}
Go to iCloud.com and sign in with the same Apple ID you use on your iPhone 5. Once you log in, you'll see the same radar icon for “Find My iPhone.” Click it. That will take you to another page that'll show you where your iPhone and other Apple devices you have are on a Google map.
Go to Settings > General > About. To the right of Model, you'll see the part number.
Find Your iPhone's Model NumberIf the model number starts with M, it was purchased new from Apple. If the model number starts with F, it was refurbished by Apple or a carrier. If the model number starts with P, it was sold as a personalized iPhone with an engraving.
For my universal app, Forex App, I'm simply using the screen height detection concept like so:
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
if (screenSize.height > 480.0f) {
/*Do iPhone 5 stuff here.*/
} else {
/*Do iPhone Classic stuff here.*/
}
} else {
/*Do iPad stuff here.*/
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With