1.详情介绍
#import<Foundation/Foundation.h>
#import<CoreGraphics/CoreGraphics.h>
#import<UIKit/UIKitDefines.h>
@classUIWindow,UIView,UIGestureRecognizer;
typedefNS_ENUM(NSInteger, UITouchPhase) {
UITouchPhaseBegan, //开始触摸
UITouchPhaseMoved, //触摸移动中
UITouchPhaseStationary, //触摸中但是没有移动
UITouchPhaseEnded, //触摸结束
UITouchPhaseCancelled, // 触摸被中断(系统的,如电话)
};
typedefNS_ENUM(NSInteger, UIForceTouchCapability) {
UIForceTouchCapabilityUnknown =0,
UIForceTouchCapabilityUnavailable =1,
UIForceTouchCapabilityAvailable =2
};
typedefNS_ENUM(NSInteger, UITouchType) {
UITouchTypeDirect, // 直接触摸
UITouchTypeIndirect, // 间接触摸
UITouchTypeStylusNS_AVAILABLE_IOS(9_1),// 笔 触摸
}NS_ENUM_AVAILABLE_IOS(9_0);
typedefNS_OPTIONS(NSInteger, UITouchProperties) {
UITouchPropertyForce = (1UL <<0),//力度
UITouchPropertyAzimuth = (1UL <<1),//方位
UITouchPropertyAltitude = (1UL <<2),//高度
UITouchPropertyLocation = (1UL <<3),// 位置
}NS_AVAILABLE_IOS(9_1);
NS_CLASS_AVAILABLE_IOS(2_0)@interface UITouch :NSObject
@property(nonatomic,readonly)NSTimeInterval timestamp;//时间戳
@property(nonatomic,readonly)UITouchPhase phase;//触摸的状态
@property(nonatomic,readonly)NSUInteger tapCount; // 触摸的手指数
@property(nonatomic,readonly)UITouchType typeNS_AVAILABLE_IOS(9_0);//触摸的类型
@property(nonatomic,readonly)CGFloat majorRadiusNS_AVAILABLE_IOS(8_0);//触摸的半径
@property(nonatomic,readonly)CGFloat majorRadiusToleranceNS_AVAILABLE_IOS