• Welcome to the all-new iMore Forums! - We're still moving some things around, so you may see a few quirks here and there, but we're working on getting things fully completed as soon as possible. For now, take a look around, and if you run into any major issues, please let us know in this thread!

Objective c how detect iphone, iphone5 and iPad

Jack Hard

New member
Oct 11, 2012
26
0
0
In my application objective c. How to detect if is an iphone or ipad or iPhone5 ?

if([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPhone){
//[iphone]
}else{
//[ipad]
}
 

anon(2353369)

New member
Feb 20, 2012
380
0
0
In my application objective c. How to detect if is an iphone or ipad or iPhone5 ?

if([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPhone){
//[iphone]
}else{
//[ipad]
}

Picture please to define it.


Sent from my iP5 using Tapatalk