zoukankan      html  css  js  c++  java
  • UIKit框架之UITouch

    1.继承链:NSObject

    2.获取触发点的位置

        (1)- (CGPoint)locationInView:(UIView *)view  :返回指定视图的触发点的位置

        (2)- (CGPoint)previousLocationInView:(UIView *)view  :返回指定视图的上一个触发点的位置

        (3)@property(nonatomicreadonlystrongUIView *view  :读取当前被触摸的视图

        (4)@property(nonatomicreadonlystrongUIWindow *window  :读取当前被触摸的窗口

        (5)@property(nonatomicreadonlyCGFloat majorRadius  :读取触摸点的半径

        (6)@property(nonatomicreadonlyCGFloat majorRadiusTolerance  :读取触摸点半径的精确值

        (7)- (CGPoint)preciseLocationInView:(UIView *)view  :读取指定视图被触摸的点的精确位置

        (8)- (CGPoint)precisePreviousLocationInView:(UIView *)view  :返回指定视图被触摸的上一个点的精确位置

    3.获取触摸点的属性

        (1)@property(nonatomicreadonlyNSUInteger tapCount  :读取屏幕被点击的次数

        (2)@property(nonatomicreadonlyNSTimeInterval timestamp  :当发生触摸的开始时间或者是上一个 触摸点结束的时间

        (3)@property(nonatomicreadonlyUITouchType type  :返回触摸的类型

        (4)@property(nonatomicreadonlyUITouchPhase phase  :读取触摸的阶段

        (5)@property(nonatomicreadonlyCGFloat force  :触摸点受压的力度

        (6)@property(nonatomicreadonlyCGFloat maximumPossibleForce  :触摸点最大合理受压的力度

        (7)@property(nonatomicreadonlyCGFloat altitudeAngle  :

    • 当笔平行于平面时,该值为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(nonatomicreadonlyUITouchProperties estimatedProperties  :当前触摸对象估计的触摸特性,返回值是UITouchPropertyies

        (11)@property(nonatomicreadonlyNSNumber *estimationUpdateIndex  :当每个触摸对象的触摸特性发生变化时,该值将会单独增加,返回值是NSNumber

        (12)@property(nonatomicreadonlyUITouchProperties estimatedPropertiesExpectingUpdates  :获取被期望要输入记性更新的一连串触发点属性

    3.获取触摸对象的手势识别器

        (1)@property(nonatomicreadonlycopyNSArray <UIGestureRecognizer *> *gestureRecognizers  :读取触摸对象接收的手势识别器组成的数组

    4.在sprite kit框架里面使用触摸事件

        (1)- (CGPoint)locationInNode:(SKNode *)node  :返回一个在指定节点上的当前位置

        (2)- (CGPoint)previousLocationInNode:(SKNode *)node  :返回一个在指定节点上的前一个位置

    5.辅助常量

        (1)UIForceTouchCapability常量

    UIForceTouchCapabilityUnknown = 0,  :无法检测压力的大小

    UIForceTouchCapabilityUnavailable = 1,  :无法使用受压检测的能力

    UIForceTouchCapabilityAvailable = 2  :可以使用受压检测的能力

        (2)UITouchType的常量

         UITouchTypeDirect,  :来自屏幕点击的直接触摸

        UITouchTypeIndirect,  :不是来自屏幕的间接触摸

        UITouchTypeStylus  :来自触摸笔的触摸

        (3)UITouchProperties常量

    UITouchPropertyForce = (1UL << 0),  :

    UITouchPropertyAzimuth = (1UL << 1),

    UITouchPropertyAltitude = (1UL << 2),

    UITouchPropertyLocation = (1UL << 3),

        (4)UITouchPhase常量

    UITouchPhaseBegan,  :触摸开始

    UITouchPhaseMoved,  :触摸移动

    UITouchPhaseStationary,  :触摸静止

    UITouchPhaseEnded,  :触摸结束

    UITouchPhaseCancelled,  :触摸取消

  • 相关阅读:
    关于matplotlib绘制直方图偏移的问题
    XP下 无法定位程序输入点WSAPoll于动态链接库ws2_32.dll 的解决办法
    Ubuntu 拨号上网及校园网开启IPV6
    php性能优化
    Mac OS X 10.11.6 重置root密码
    php 接口类与抽象类的实际作用
    Redis Cluster集群的搭建与实践
    nginx 反向代理 取得真实IP和域名
    mysql主从配置,出错
    mycat水平分片规则
  • 原文地址:https://www.cnblogs.com/lelun/p/5722442.html
Copyright © 2011-2022 走看看