- #import
"DeviceHelper.h" - #import
"sys/utsname.h" -
- @implementation
DeviceHelper -
-
- +
(NSString *)getDeviceVersion - {
-
struct utsname systemInfo; -
uname(&systemInfo); -
//get the device model and the system version -
NSString *machine =[NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]; -
return machine; - }
-
-
- +
(NSString*)getOSVersion - {
-
return [[UIDevice currentDevice]systemVersion]; - }
-
-
- +
(BOOL)isIpad - {
-
return [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad; - }
-
-
-
- +
(BOOL)isIphone - {
-
return [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhon e; -
- }
-
-
- +
(BOOL)hasCamera - {
-
return [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerS ourceTypeCamera]; - }
-
- @end
获取机器信息
最新推荐文章于 2023-01-01 09:51:00 发布