Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to know is it iphone or ipad?

i want to know the user uses the iphone or ipad,if the user uses the iphone i want to open the camera,if he uses the ipad or runs in simulator i want to open the library. how it is possible? how to find the details of devices? how to know current using device by user through xcode?

like image 584
Anand Avatar asked Nov 27 '22 21:11

Anand


1 Answers

NSString *deviceType = [UIDevice currentDevice].model;

if([deviceType isEqualToString:@"iPhone"])
{
     //your code
}
.....

Hope this helps.

EDIT:

See this thread -determine-device-iphone-ipod-touch-with-iphone-sdk .

like image 152
Vaibhav Tekam Avatar answered Dec 24 '22 16:12

Vaibhav Tekam