1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| //获取当前设备单例 + (UIDevice *)currentDevice; //获取当前设备名称 @property(nonatomic,readonly,strong) NSString *name; // e.g. "My iPhone" //获取当前设备模式 @property(nonatomic,readonly,strong) NSString *model; // e.g. @"iPhone", @"iPod touch" //获取本地化的当前设备模式 @property(nonatomic,readonly,strong) NSString *localizedModel; // localized version of model //获取系统名称 @property(nonatomic,readonly,strong) NSString *systemName; // e.g. @"iOS" //获取系统版本 @property(nonatomic,readonly,strong) NSString *systemVersion; // e.g. @"4.0" //获取设备方向 @property(nonatomic,readonly) UIDeviceOrientation orientation; //获取设备UUID对象 @property(nullable, nonatomic,readonly,strong) NSUUID *identifierForVendor; //是否开启监测电池状态 开启后 才可以正常获取电池状态 @property(nonatomic,getter=isBatteryMonitoringEnabled) BOOL batteryMonitoringEnabled NS_AVAILABLE_IOS(3_0); // default is NO //获取电池状态 @property(nonatomic,readonly) UIDeviceBatteryState batteryState NS_AVAILABLE_IOS(3_0); //获取电量 @property(nonatomic,readonly) float batteryLevel NS_AVAILABLE_IOS(3_0);
|