【问题标题】:How to enable/disable touchesMoved, touchesEnded and Swipe Gestures如何启用/禁用 touchesMoved、touchesEnded 和 Swipe Gestures
【发布时间】:2016-04-18 07:53:26
【问题描述】:

我正在开发一个需要 touchesMovedtouchesEnded 的游戏,但是在阶段完成后,我想禁用 touchesMovedtouchesEnded 并启用 only SWIPE GESTURES .

那么我该如何实现呢?

在玩游戏时:我希望禁用滑动手势并启用touchesBegantouchesMovedtouchesEnded

游戏结束后:我想禁用touchesBegantouchesMovedtouchesEnded 并启用滑动手势。

请帮帮我。谢谢。

【问题讨论】:

    标签: swift swift2 tvos touchesmoved touchesended


    【解决方案1】:

    当你想禁用触摸时,在下面的方法中返回 false。

     func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldReceiveTouch touch: UITouch) -> Bool {
        return false
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-10
      • 2013-01-29
      • 1970-01-01
      • 1970-01-01
      • 2021-04-20
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      相关资源
      最近更新 更多