determine ipad device

前端 未结 5 1476
情歌与酒
情歌与酒 2020-12-09 00:18

I am writing a universal app for both iphone and ipad. How do I determine if the device is an iPad. I have used this link to determine the iPhone type (3G, 3GS).

Det

5条回答
  •  攒了一身酷
    2020-12-09 00:54

    if ( [(NSString*)[UIDevice currentDevice].model isEqualToString:@"iPad"] ) {
                NSLog(@"...in iPad");         
    } else {
                NSLog(@"...in iPhone/iPod");              
    }
    

提交回复
热议问题