想要识别
UIGestureRecognizer本身的 touchesBegan、touchesMoved、touchesEnded、touchesEnded。
需要自定义
UIGestureRecognizer的同时,
导入import UIKit.UIGestureRecognizerSubclass就可以了。
import UIKit
import UIKit.UIGestureRecognizerSubclass
class GestureRecognizer: UIGestureRecognizer {
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent) {
<#code#>
}
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent) {
<#code#>
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent) {
<#code#>
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent) {
<#code#>
}
}









网友评论