1.继承链:NSObject
2.获取触发点的位置
(1)- (CGPoint)locationInView:(UIView *)view
:返回指定视图的触发点的位置
(2)- (CGPoint)previousLocationInView:(UIView *)view
:返回指定视图的上一个触发点的位置
(3)@property(nonatomic, readonly, strong) UIView*view :读取当前被触摸的视图
(4)@property(nonatomic, readonly, strong) UIWindow*window :读取当前被触摸的窗口
(5)@property(nonatomic, readonly) CGFloatmajorRadius :读取触摸点的半径
(6)@property(nonatomic, readonly) CGFloatmajorRadiusTolerance :读取触摸点半径的精确值
(7)- (CGPoint)preciseLocationInView:(UIView *)view
:读取指定视图被触摸的点的精确位置
(8)- (CGPoint)precisePreviousLocationInView:(UIView *)view
:返回指定视图被触摸的上一个点的精确位置
3.获取触摸点的属性
(1)@property(nonatomic, readonly) NSUIntegertapCount :读取屏幕被点击的次数
(2)@property(nonatomic, readonly) NSTimeIntervaltimestamp :当发生触摸的开始时间或者是上一个 触摸点结束的时间
(3)@property(nonatomic, readonly) UITouchTypetype :返回触摸的类型
(4)@property(nonatomic, readonly) UITouchPhasephase :读取触摸的阶段
(5)@property(nonatomic, readonly) CGFloatforce :触摸点受压的力度
(6)@property(nonatomic, readonly) CGFloatmaximumPossibleForce :触摸点最大合理受压的力度
(7)@property(nonatomic, readonly) CGFloataltitudeAngle :
- 当笔平行于平面时,该值为0
- 当笔垂直于平面时,该值为Pi / 2
,A value of 0
radians indicates that the stylus is parallel to the surface; when the stylus is perpendicular to the surface, altitudeAngle
is Pi/2
.
(8)- (CGFloat)azimuthAngleInView:(UIView *)view
:沿着x轴正向的方位角,当与x轴正向方向相同时,该值为0
(9)- (CGVector)azimuthUnitVectorInView:(UIView *)view
:当前触摸对象的方向上的单位向量当view参数为nil时,默认为keyWindow
(10)@property(nonatomic, readonly) UITouchPropertiesestimatedProperties :当前触摸对象估计的触摸特性,返回值是UITouchPropertyies
(11)@property(nonatomic, readonly) NSNumber*estimationUpdateIndex :当每个触摸对象的触摸特性发生变化时,该值将会单独增加,返回值是NSNumber
(12)@property(nonatomic, readonly) UITouchPropertiesestimatedPropertiesExpectingUpdates :获取被期望要输入记性更新的一连串触发点属性
3.获取触摸对象的手势识别器
(1)@property(nonatomic, readonly, copy) NSArray<UIGestureRecognizer *> *gestureRecognizers :读取触摸对象接收的手势识别器组成的数组
4.在sprite kit框架里面使用触摸事件
(1)- (CGPoint)locationInNode:(SKNode *)node
:返回一个在指定节点上的当前位置
(2)- (CGPoint)previousLocationInNode:(SKNode *)node
:返回一个在指定节点上的前一个位置
5.辅助常量
UIForceTouchCapabilityUnknown = 0, :无法检测压力的大小
UIForceTouchCapabilityUnavailable = 1, :无法使用受压检测的能力
UIForceTouchCapabilityAvailable = 2 :可以使用受压检测的能力
(2)UITouchType的常量
UITouchTypeIndirect, :不是来自屏幕的间接触摸
UITouchTypeStylus :来自触摸笔的触摸
(3)UITouchProperties常量
UITouchPropertyForce = (1UL << 0), :
UITouchPropertyAzimuth = (1UL << 1),
UITouchPropertyAltitude = (1UL << 2),
UITouchPropertyLocation = (1UL << 3),
(4)UITouchPhase常量
UITouchPhaseBegan, :触摸开始
UITouchPhaseMoved, :触摸移动
UITouchPhaseStationary, :触摸静止
UITouchPhaseEnded, :触摸结束
UITouchPhaseCancelled, :触摸取消