if (@available(iOS 10.0, *)) {
self.view.backgroundColor = [UIColor colorWithDisplayP3Red:255.0/255 green:105.0/255 blue:180.0/255 alpha:1.0];
} else {
// Fallback on earlier versions
}
或者直接获取手机的系统版本号作为判断
+(double)systemVersion{
NSString *version = [UIDevice currentDevice].systemVersion;
return version.doubleValue;
}