判断设备是否是ipad
BOOL isPad() {
#ifdef UI_USER_INTERFACE_IDIOM
return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
#else
return NO;
#endif
}
判断设备是否是iphone5
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
判断当前设备的版本
[[[UIDevice currentDevice] systemVersion] floatValue]
写成宏
#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]