简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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