UIDevice-b
typedef NS_ENUM(NSInteger, UIDeviceOrientation) //设备方向
{
UIDeviceOrientationUnknown,
UIDeviceOrientationPortrait, // 竖向,头向上
UIDeviceOrientationPortraitUpsideDown, // 竖向,头向下
UIDeviceOrientationLandscapeLeft, // 横向,头向左
UIDeviceOrientationLandscapeRight, // 横向,头向右
UIDeviceOrientationFaceUp, // 平放,屏幕朝下
UIDeviceOrientationFaceDown // 平放,屏幕朝下
};
typedef NS_ENUM(NSInteger, UIDeviceBatteryState) //电池状态
{
UIDeviceBatteryStateUnknown,
UIDeviceBatteryStateUnplugged, // 未充电
UIDeviceBatteryStateCharging, // 正在充电
UIDeviceBatteryStateFull, // 满电
};
typedef NS_ENUM(NSInteger, UIUserInterfaceIdiom) //用户界面类型
{
//iOS3.2以上有效
#if __IPHONE_3_2 <= __IPHONE_OS_VERSION_MAX_ALLOWED
UIUserInterfaceIdiomPhone, // iPhone 和 iPod touch 风格
UIUserInterfaceIdiomPad, // iPad 风格
#endif
};
#define UI_USER_INTERFACE_IDIOM() ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] ? [[UIDevice currentDevice] userInterfaceIdiom] : UIUserInterfaceIdiomPhone)
#define UIDeviceOrientationIsPortrait(orientation) ((orientation) == UIDeviceOrientationPortrait || (orientation) == UIDeviceOrientationPortraitUpsideDown)
#define UIDeviceOrientationIsLandscape(orientation) ((orientation) == UIDeviceOrientationLandscapeLeft || (orientation) == UIDeviceOrientationLandscapeRight)
NS_CLASS_AVAILABLE_IOS(2_0) @interface UIDevice : NSObject {
@private
NSInteger _numDeviceOrientationObservers;
float _batteryLevel;
struct {
unsigned int batteryMonitoringEnabled:1;
unsigned int proximityMonitoringEnabled:1;
unsigned int expectsFaceContactInLandscape:1;
unsigned int orientation:3;
unsigned int batteryState:2;
unsigned int proximityState:1;
} _deviceFlags;
}
+ (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; // 除非正在生成设备方向的通知,否则返回UIDeviceOrientationUnknown 。
@property(nonatomic,readonly,retain) NSUUID *identifierForVendor NS_AVAILABLE_IOS(6_0); // 可用于唯一标识该设备,同一供应商不同应用具有相同的UUID 。
@property(nonatomic,readonly,getter=isGeneratingDeviceOrientationNotifications) BOOL generatesDeviceOrientationNotifications; //是否生成设备转向通知
- (void)beginGeneratingDeviceOrientationNotifications;
- (void)endGeneratingDeviceOrientationNotifications;
@property(nonatomic,getter=isBatteryMonitoringEnabled) BOOL batteryMonitoringEnabledNS_AVAILABLE_IOS(3_0); // 是否启动电池监控,默认为NO
@property(nonatomic,readonly) UIDeviceBatteryState batteryState NS_AVAILABLE_IOS(3_0); // 如果禁用电池监控,则电池状态为UIDeviceBatteryStateUnknown
@property(nonatomic,readonly) float batteryLevel NS_AVAILABLE_IOS(3_0); //电量百分比, 0 .. 1.0。如果电池状态为UIDeviceBatteryStateUnknown,则百分比为-1.0
@property(nonatomic,getter=isProximityMonitoringEnabled) BOOL proximityMonitoringEnabledNS_AVAILABLE_IOS(3_0); // 是否启动接近监控(例如接电话时脸靠近屏幕),默认为NO
@property(nonatomic,readonly) BOOL proximityState NS_AVAILABLE_IOS(3_0); // 如果设备不具备接近感应器,则总是返回NO
@property(nonatomic,readonly,getter=isMultitaskingSupported) BOOL multitaskingSupportedNS_AVAILABLE_IOS(4_0); // 是否支持多任务
@property(nonatomic,readonly) UIUserInterfaceIdiom userInterfaceIdiom NS_AVAILABLE_IOS(3_2); // 当前用户界面模式
- (void)playInputClick NS_AVAILABLE_IOS(4_2); // 播放一个输入的声音
@end
@protocol UIInputViewAudioFeedback
@optional
@property (nonatomic, readonly) BOOL enableInputClicksWhenVisible; // 实现该方法,返回YES则自定义的视图能够播放输入的声音
@end
UIKIT_EXTERN NSString *const UIDeviceOrientationDidChangeNotification; // 屏幕方向变化通知
UIKIT_EXTERN NSString *const UIDeviceBatteryStateDidChangeNotification NS_AVAILABLE_IOS(3_0); // 电池状态变化通知
UIKIT_EXTERN NSString *const UIDeviceBatteryLevelDidChangeNotification NS_AVAILABLE_IOS(3_0); // 电池电量变化通知
UIKIT_EXTERN NSString *const UIDeviceProximityStateDidChangeNotification NS_AVAILABLE_IOS(3_0); // 接近状态变化通知
UIDevice-b的更多相关文章
- Uiautomator 2.0之UiDevice新增API学习小记
1. InstrumentationRegistry类 1.1. 类说明: 一个暴露的注册实例,持有instrumentation运行的进程和参数,还提供了一种简便的方法调用instrumentati ...
- iOS 整理笔记 获取手机信息(UIDevice、NSBundle、NSLocale)
/* iOS的APP的应用开发的过程中,有时为了bug跟踪或者获取用反馈的需要自动收集用户设备.系统信息.应用信息等等,这些信息方便开发者诊断问题,当然这些信息是用户的非隐私信息,是通过开发ap ...
- iOS - YYAdd对UIDevice的拓展
YYKit中对UIDevice的拓展,accumulate knowledge !!! 首先 #include <sys/socket.h> #include <sys/sysctl ...
- iOS的UIDevice,NSBundle,NSLocale
iOS的APP的应用开发的过程中,有时为了bug跟踪或者获取用反馈的需要自动收集用 户设备.系统信息.应用信息等等,这些信息方便开发者诊断问题,当然这些信息是用户的非隐私信息,是通过开发api可以获取 ...
- IOS设备 UIDevice 获取操作系统 版本 电量 临近手机触发消息检测 (真机亲测可用)
- (void)viewDidLoad { [super viewDidLoad]; // 操作系统 NSString * osName =[[UIDevice currentDevice]syste ...
- 获取iOS系统版本 --- UIDevice
UIDevice类是一个单例,其唯一的实例( [UIDevice currentDevice] ) 代表了当前使用的设备. 通过这个实例,可以获得设备的相关信息(包括系统名称,版本号,设备模式等等). ...
- iOS - UIDevice
前言 NS_CLASS_AVAILABLE_IOS(2_0) @interface UIDevice : NSObject @available(iOS 2.0, *) public class UI ...
- iOS开发 获取手机信息(UIDevice,NSBundle,NSlocale)
在开发中,需要获取当前设备的一些信息,可以通过UIDevice,NSbundle,NSlocale获取. UIDevice UIDevice 提供了多种属性,类函数及状态通知,可以检测手机电量,定位, ...
- UIDevice通知
UIDevice通知 UIDevice类提供了一个单例对象,它代表着设备,通过它可以获得一些设备相关的信息,比如电池电量值(batteryLevel).电池状态(batteryState).设备的类型 ...
- UIDevice 系统信息详解
获取当前设备 //获取当前设备 UIDevice *dev = [UIDevice currentDevice]; 设备和系统基本信息 NSLog(@"设备名称:%@&qu ...
随机推荐
- return的用处
#include "stdio.h" main() { ,c=; ;a<;a++) { c=c+a; } printf("%d",c); return ; ...
- Oracle char 查询问题
近期碰到一个问题,数据库有个字段设置类型是char(2),然后数据库保存的数据位1,当使用hibernate 查询时 我使用query.setString("permissionLevel& ...
- linux下切割catalina.out文件,按天生成文件
1.下载工具cronolog压缩包(http://download.csdn.net/detail/sunling_sz/8144469) 2.将文件拖放到server,不论什么文件夹都能够. 3.进 ...
- Delphi QQ表情的实现
Delphi QQ表情的实现 QQ表情描述 蓝框 提示信息 鼠标在这个表情上面 这个表情才动 可以增加表情 表情打包 单击这个表情插入表情 关闭本窗体 主要使用Webbrowsr来实现的 -- ...
- leetcode题解||Reverse Integer 问题
problem: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 ...
- SystemTap----常用变量、宏、函数和技巧
http://blog.csdn.net/moonvs2010/article/category/1570309
- [CodeForce]358D Dima and Hares
有N<3000只宠物要喂,每次只能喂一只,每喂一只宠物,宠物的满足度取决于: 1 紧靠的两个邻居都没喂,a[i] 2 邻居中有一个喂过了,b[i] 3 两个邻居都喂过了,c[i] 把所有宠物喂一 ...
- ios中的界面跳转方式
ios中,两种界面跳转方式 1.NavgationController本身可以作为普通ViewController的容器,它有装Controller的栈,所以可以push和pop它们,实现你所说的跳转 ...
- CGLIB学习笔记
0 概述 CGLIB基于ASM实现.提供比反射更为强大的动态特性.使用CGLIB可以非常方便的实现的动态代理. 0.1 CGLIB包结构 net.sf.cglib.core 底层字节码处理类. ...
- 10.30 afternoon
P76竞赛时间: ????年??月??日??:??-??:?? 题目名称 他 她 它 名称 he she it 输入 he.in she.in it.in 输出 he.out she.out it.o ...