📜  swift 允许手势识别器优于其他人 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:01:03.484000             🧑  作者: Mango

代码示例2
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, 
         shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool {
   // Don't recognize a single tap until a double-tap fails.
   if gestureRecognizer == self.tapGesture && 
          otherGestureRecognizer == self.doubleTapGesture {
      return true
   }
   return false
}