首页 > 学院 > 开发设计 > 正文

判断iPhone和iPad判断设备版本

2019-11-14 17:52:57
字体:
来源:转载
供稿:网友

 

//判断iphone和iPad

#define IS_IPHONE (!IS_IPAD)

#define IS_IPAD (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPhone)

//判断设备版本

#define IS_IOS6_LAGACY floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1

#define IS_IOS7 floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1

#define IS_IOS5_LAGACY floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_5_1

#define IS_IOS6_AFTER floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_5_1

 


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表