Retina (3.5/4 inch Screen) or Non-Retina 比量
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { if ([[UIScreen mainScreen] scale] == 2.0) { if([UIScreen mainScreen].bounds.size.height == 568){ // iPhone retina-4 inch } else{ // iPhone retina-3.5 inch } } else { // not retina display }
iOS6/iOS7 推断
NSString *ver = [[UIDevice currentDevice] systemVersion]; float ver_float = [ver floatValue]; if (ver_float >= 7.0) { //iOS >=7 } else{ //iOS <7 }
版权声明:本文博主原创文章,博客,未经同意不得转载。