iPhone: Retrieve system details
Compared with the Android platform, the segmentation on Apple mobile technology is very limited. Literally, there are 3 versions of the iPhone and 2 versions of the iPod Touch, all of them with the same screen resolution.
Still, there are differences that need to be accounted for when developing for this platform. In this article, you'll find couple of lists of useful methods as well as couple of lines to help you perform different logic based on the device.
Image courtesy of cogdogblog.
System name and version:
[[UIDevice currentDevice] systemName]
[[UIDevice currentDevice] systemVersion]
Device name and unique identifier:
[[UIDevice currentDevice] name]
[[UIDevice currentDevice] uniqueIdentifier]
How to perform various actions based on device type
NSString *device = [[UIDevice currentDevice] model];
if([device isEqualToString:@"iPhone"]) {
// Original iPhone
...
} else if([device isEqualToString:@"iPhone 3G"]) {
// iPhone 3G
...
} else if([device isEqualToString:@"iPhone 3G S"]) {
// iPhone 3GS
....
} else if([device isEqualToString:@"iPod touch"]) {
// 1st generation iPod Touch
...
} else if([device isEqualToString:@"iPod touch 2G"]) {
// 2nd generation iPod Touch
...
}
