1.版本判断使用API 新旧方法。
if __IPHONE_OS_VERSION_MIN_REQUIRED < 90000
appearance = [UIActivityIndicatorView appearanceWhenContainedIn:[MBProgressHUD class], nil];
else
// For iOS 9+
appearance = [UIActivityIndicatorView appearanceWhenContainedInInstancesOfClasses:@[[MBProgressHUD class]]];
endif
2.[[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0
大于9.0 小于8.0
3.BOOL iOS9OrLater = kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_9_0;
系统判断
网友评论