判断iPhone和iPad 判断设备版本

时间:2023-03-08 18:52:45
判断iPhone和iPad         判断设备版本

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