![](/img/trans.png)
[英]When do “finger” events get sent as Gestures to UIGestureRecognizer vs touchesBegan/touchesMoved/touchesEnded to UIView
[英]How to enable/disable touchesMoved, touchesEnded and Swipe Gestures
我正在開發需要touchesMoved
和touchesEnded
的游戲,但是在階段完成之后,我想禁用touchesMoved
和touchesEnded
並僅啟用SWIPE GESTURES
touchesEnded
。
那么我該如何實現呢?
在玩游戲時 :我希望禁用滑動手勢, touchesEnded
應該啟用touchesBegan
, touchesMoved
, touchesEnded
。
游戲結束時 :我希望touchesBegan
, touchesMoved
, touchesEnded
被禁用,並且要啟用滑動手勢。
請幫幫我。 謝謝。
如果要禁用觸摸,請按以下方法返回false。
func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldReceiveTouch touch: UITouch) -> Bool {
return false
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.