IOS - [UIDevice currentDevice] name/model/localizedMode/systemName/systemVersion...../userInterfaceIdiom

+ (UIDevice *)currentDevice;

@property(nonatomic,readonly,retain) NSString    *name;              // e.g. "My iPhone"

@property(nonatomic,readonly,retain) NSString    *model;             // e.g. @"iPhone", @"iPod touch"

@property(nonatomic,readonly,retain) NSString    *localizedModel;    // localized version of model

@property(nonatomic,readonly,retain) NSString    *systemName;        // e.g. @"iOS"

@property(nonatomic,readonly,retain) NSString    *systemVersion;     // e.g. @"4.0"

@property(nonatomic,readonly) UIDeviceOrientation orientation;       // return current device orientation.  this will return UIDeviceOrientationUnknown unless device orientation notifications are being generated.

@property(nonatomic,readonly,retain) 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;

- (void)beginGeneratingDeviceOrientationNotifications;      // nestable

- (void)endGeneratingDeviceOrientationNotifications;

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

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

@property(nonatomic,readonly) float                         batteryLevel NS_AVAILABLE_IOS(3_0);  // 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);

- (void)playInputClick NS_AVAILABLE_IOS(4_2);  // Plays a click only if an enabling input view is on-screen and user has enabled input clicks.

时间: 2024-07-28 13:52:03

IOS - [UIDevice currentDevice] name/model/localizedMode/systemName/systemVersion...../userInterfaceIdiom的相关文章

获取iOS系统版本号,慎重使用[[[UIDevice currentDevice] systemVersion] floatValue]——【sdk缺陷】

iOS 最常见的获取系统版本的方法是: [[[UIDevice currentDevice] systemVersion] floatValue] 可是.这个floatValue是不靠谱的,这也算是iOS SDK的一个bug吧.看一下上面的函数在8.2系统上的表现. 假设代码中有 if( version >= 8.2) 的推断,则该推断会失效. 所以,还是使用字符串对照版本比較靠谱.

获取iOS系统版本,谨慎使用[[[UIDevice currentDevice] systemVersion] floatValue]

iOS 最常见的获取系统版本号的方法是: [[[UIDevice currentDevice] systemVersion] floatValue] 但是,这个floatValue是不靠谱的,这也算是iOS SDK的一个bug吧.看一下上面的函数在8.2系统上的表现. 如果代码中有 if( version >= 8.2) 的判断,则该判断会失效! 所以,还是使用字符串对比版本号比较靠谱.

IOS UIDevice & IOS检测屏幕旋转实例

一 UIDevice 简介 UIDevice类提供了一个单例实例代表当前的设备.从这个实例中可以获得的信息设备,比如操作系统名称.电池电量值(batteryLevel).电池状态(batteryState).设备的类型(model,比如iPod.iPhone等).设备的系统(systemVersion) 二 获取 UIDevice 实例 通过[UIDevice currentDevice]可以获取这个单粒对象 UIDevice *device = [UIDevice currentDevice]

[UIDevice currentDevice]

获取iphone的系统信息使用[UIDevice currentDevice],信息如下: [[UIDevice currentDevice] systemName]:系统名称,如iPhone OS [[UIDevice currentDevice] systemVersion]:系统版本,如iOS 8.0 [[UIDevice currentDevice] model]:The model of the device,如iPhone或者iPod touch [[UIDevice current

iOS端JSON转Model链式编程框架SuperKVC使用方法与原理

背景 在client编程中.字典转模型是一个极为常见的问题,苹果提供了KVC来实现NSDictionary到Model的注入,可是KVC仅仅能进行单层浅注入.且无法处理类型转换.key与属性名不正确应.深度注入等问题,笔者从Masonry得到启示,开发了一个通过链式配置注入器实现深度注入.类型转换.key-属性名映射等功能的轻量级注入框架SuperKVC.眼下已经开源到GitHub,点击这里前往.欢迎Star和Fork.欢迎和我一起完好这个框架! 本文将从应用和原理两个角度介绍SuperKVC

IOS UIDevice距离传感器(打开 关闭)

●  什么是传感器 ●  传感器是一种感应\检测装置, 目前已经广泛应用于智能手机上 ●  iPhone5中内置的传感器有 ●  运动传感器\加速度传感器\加速计(Motion/Accelerometer Sensor) ●  环境光传感器(Ambient Light Sensor) ●  距离传感器(Proximity Sensor) ●  磁力计传感器(Magnetometer Sensor) ●  内部温度传感器(Internal Temperature Sensor) ●  湿度传感器(

IOS 字典快速转换为Model

一般情况下IOS得局部页面加载的过程是,创建一个Model然后,将Nib文件与Model进行关联,然后能够快速的获取到Nib文件上的控件实例.操作生成页面. 但是原生的内容是没有直接通过Json获取Model只能生成字典.然后转换为Model.下列方法就是通过字典来转换为Model的过程. 将字典转换为Model -(BOOL)reflectDataFromOtherObject:(NSDictionary *)dic { unsigned int outCount, i; objc_prope

iOS & Mac JSON To Model

NSString * jsonPath=[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Contents.json"]; NSString * jsonStr=[[NSString alloc] initWithData:[NSData dataWithContentsOfFile:jsonPath] encoding:NSUTF8StringEncoding]; NSLog(@"%

iOS开发>学无止境 - 遍历Model类的属性并完善使用Runtime给Model类赋值

在前几天的一篇博客<iOS开发之使用Runtime给Model类赋值>中介绍了如何使用运行时在实体类的基类中添加给实体类的属性赋值的方法,这个方法的前提是字典的Key必须和实体类的Property Name相同,然后通过运行时来生成和执行Setter方法给Model类的属性赋值. 通 过Runtime来给Model类属性赋值的好处是多多的,它便于代码的后期维护,并且提高了开发效率.当你拿到解析后的字典时你不用一个一个的通过 key去把字典的值赋值给相应的Model类的属性,本篇博客中会给出如何