获取iPhone型号
生活随笔
收集整理的這篇文章主要介紹了
获取iPhone型号
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
?
OC代碼一欄
// 需導(dǎo)入 #import "sys/utsname.h"#pragma mark - 獲取iPhone型號/// 獲取iPhone型號 - (NSString*)stringiPhoneDeviceVersion {struct utsname systemInfo;uname(&systemInfo);NSString*platform = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];if([platform isEqualToString:@"iPhone3,1"])return@"iPhone 4";if([platform isEqualToString:@"iPhone3,2"])return@"iPhone 4";if([platform isEqualToString:@"iPhone3,3"])return@"iPhone 4";if([platform isEqualToString:@"iPhone4,1"])return@"iPhone 4S";if([platform isEqualToString:@"iPhone5,1"])return@"iPhone 5";if([platform isEqualToString:@"iPhone5,2"])return@"iPhone 5";if([platform isEqualToString:@"iPhone5,3"])return@"iPhone 5c";if([platform isEqualToString:@"iPhone5,4"])return@"iPhone 5c";if([platform isEqualToString:@"iPhone6,1"])return@"iPhone 5s";if([platform isEqualToString:@"iPhone6,2"])return@"iPhone 5s";if([platform isEqualToString:@"iPhone7,1"])return@"iPhone 6 Plus";if([platform isEqualToString:@"iPhone7,2"])return@"iPhone 6";if([platform isEqualToString:@"iPhone8,1"])return@"iPhone 6s";if([platform isEqualToString:@"iPhone8,2"])return@"iPhone 6s Plus";if([platform isEqualToString:@"iPhone8,4"])return@"iPhone SE";return platform;}OC-->Demo點此下載
學(xué)自:http://www.jianshu.com/p/37b0dbe73cf2
轉(zhuǎn)載于:https://my.oschina.net/codeismygirl/blog/678406
總結(jié)
以上是生活随笔為你收集整理的获取iPhone型号的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Three.js学习笔记
- 下一篇: 寻找最大的K个数,Top K问题的堆实现