·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> app软件开发 >> IOS开发 >> 判断iPhone和iPad判断设备版本

判断iPhone和iPad判断设备版本

作者:佚名      IOS开发编辑:admin      更新时间:2022-07-23

 

//判断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