In my application (written in Objective-C), how do I detect if the device is an iPhone, iPad, or iPhone5?
if([[UIDevice currentDevice]userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
// [iphone] or [itouch]
} else {
// [ipad]
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you can easly detect iphone, iphone5 and iPad with below condition (But not iTouch! iTouch is treated as if it were an iPhone with this code!):-
UPDATE
You can also use MACRO or define Variable for check is that iPhone5,iPhone4 or iPad like Bellow:-
Example:-