Swift - How to remove swipe gesture from scene when moving to another one?

前端 未结 3 1013
死守一世寂寞
死守一世寂寞 2021-01-03 14:32

So my game uses swipe gestures, in my didMoveToView() function I have these gestures initialized:

            let swipeRight = UISwipeGestureRecognizer()
            


        
3条回答
  •  别那么骄傲
    2021-01-03 15:02

    You are removing all kind of gesture, try this:

    if([recognizer isKindOfClass:[UISwipeGestureRecognizer class]]) {
        [self removeGestureRecognizer:recognizer];
    }
    

    Hope this helps.. :)

提交回复
热议问题