zoukankan      html  css  js  c++  java
  • 关于UIGestureRecognizerState

    UIGestureRecognizerState的定义如下

    typedef enum {
        UIGestureRecognizerStatePossible, 
        UIGestureRecognizerStateBegan, 
        UIGestureRecognizerStateChanged, 
        UIGestureRecognizerStateEnded, 
        UIGestureRecognizerStateCancelled,
        UIGestureRecognizerStateFailed,  
        UIGestureRecognizerStateRecognized = UIGestureRecognizerStateEnded 
    } UIGestureRecognizerState;

    Possible: 识别器在未识别出它的手势,但可能会接收到触摸时处于这个状态。这是默认状态。

    Began: 识别器接收到触摸并识别出是它的手势时处于这个状态。响应方法将在下个循环步骤中被调用。

    Changed:the recognizer has received touches recognized as a change to the gesture. (不懂怎么翻译,理解上就是识别器识别出一个变化为它的手势的触摸),响应方法将在下个循环步骤中被调用。

    Ended:识别器在识别到作为当前手势结束信号的触摸时处于这个状态。响应方法将在下个循环步骤中被调用 并且 识别器将重置为possible状态。

    Cancelled:识别器处于取消状态.响应方法将在下个循环步骤中被调用 并且 识别器将重置为possible状态。

    Failed: 识别器接收到不能识别为它的手势的一系列触摸。响应方法不会被调用 并且 识别器将重置为possible状态。

    Recognized: 识别器已识别到它的手势。响应方法将在下个循环步骤中被调用 并且 识别器将重置为possible状态。

    ps:代码里还有一段注释,不是很懂

    // Discrete Gestures – gesture recognizers that recognize a discrete event but do not report changes (for example, a tap) do not transition through the Began and Changed states and can not fail or be cancelled  (不连续的,离散的手势:识别器识别到一个独立的事件但不报告改变不变换成began和changed不能变成failed也不能变成cancelled)

    花开花谢春不管,水暖水寒鱼自知.
  • 相关阅读:
    自定义实现wcf的用户名密码验证
    EF6:编写你自己的code first 数据迁移操作(睡前来一篇,翻译的)
    .net 连接Redis
    idea external libraries 只有jdk问题
    MAC vim安装gruvbox主题
    Mac gitk安装与优化
    spring security 4 filter 顺序及作用
    mysql 采样查询 / 间隔查询 / 跳跃查询的两种实现思路
    nginx warn an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/ while reading upstream
    nginx日志 logrotate配置
  • 原文地址:https://www.cnblogs.com/taintain1984/p/3408013.html
Copyright © 2011-2022 走看看