UIDevice 获取设备相关信息备忘

使用方法:

[[UIDevice currentDevice] systemVersion];//获取系统版本号

下面是UIDevice.h 中的一些信息,都可以按照上面的调用方式获取


@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 __TVOS_PROHIBITED;       // return current device orientation.  this will return UIDeviceOrientationUnknown unless device orientation notifications are being generated.


@property(nullable, nonatomic,readonly,strong) NSUUID      *identifierForVendor NS_AVAILABLE_IOS(6_0);      // a UUID that may be used to uniquely identify the device, same across apps from a single vendor.


@property(nonatomic,readonly,getter=isGeneratingDeviceOrientationNotifications) BOOL generatesDeviceOrientationNotifications __TVOS_PROHIBITED;

- (void)beginGeneratingDeviceOrientationNotifications __TVOS_PROHIBITED;      // nestable

- (void)endGeneratingDeviceOrientationNotifications __TVOS_PROHIBITED;


@property(nonatomic,getter=isBatteryMonitoringEnabled) BOOL batteryMonitoringEnabled NS_AVAILABLE_IOS(3_0) __TVOS_PROHIBITED// default is NO

@property(nonatomic,readonly) UIDeviceBatteryState          batteryState NS_AVAILABLE_IOS(3_0) __TVOS_PROHIBITED// UIDeviceBatteryStateUnknown if monitoring disabled

@property(nonatomic,readonly) float                         batteryLevel NS_AVAILABLE_IOS(3_0) __TVOS_PROHIBITED// 0 .. 1.0. -1.0 if UIDeviceBatteryStateUnknown


@property(nonatomic,getter=isProximityMonitoringEnabled) BOOL proximityMonitoringEnabled NS_AVAILABLE_IOS(3_0); // default is NO

@property(nonatomic,readonly)                            BOOL proximityState NS_AVAILABLE_IOS(3_0);  // always returns NO if no proximity detector


@property(nonatomic,readonly,getter=isMultitaskingSupported) BOOL multitaskingSupported NS_AVAILABLE_IOS(4_0);


@property(nonatomic,readonly) UIUserInterfaceIdiom userInterfaceIdiom NS_AVAILABLE_IOS(3_2);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值