簡體   English   中英

如何啟用/禁用觸摸已移動,觸摸已終止和滑動手勢

[英]How to enable/disable touchesMoved, touchesEnded and Swipe Gestures

我正在開發需要touchesMovedtouchesEnded的游戲,但是在階段完成之后,我想禁用touchesMovedtouchesEnded啟用SWIPE GESTURES touchesEnded

那么我該如何實現呢?

在玩游戲時 :我希望禁用滑動手勢, touchesEnded應該啟用touchesBegantouchesMovedtouchesEnded

游戲結束時 :我希望touchesBegantouchesMovedtouchesEnded被禁用,並且要啟用滑動手勢。

請幫幫我。 謝謝。

如果要禁用觸摸,請按以下方法返回false。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM