简体   繁体   English

如何禁用滑动手势识别器?

[英]How to disable swipe gesture recognizer?

I have swipe gesture 我有滑动手势

@IBAction func rightSwipe(_ sender: UISwipeGestureRecognizer) {
    self.view.backgroundColor = UIColor.green
}

I want to temporarily disable this swipe using long press. 我想使用长按暂时禁用此滑动。

@IBAction func LongPress(_ sender: UILongPressGestureRecognizer) {

}

How can I do it? 我该怎么做?

使用yourSwipeGestureRecognizer.isEnabled = false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM