想要識別
UIGestureRecognizer
本身的 touchesBegan蟹倾、touchesMoved疚脐、touchesEnded征候、touchesEnded匠襟。
需要自定義
UIGestureRecognizer
的同時(shí),
導(dǎo)入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#>
}
}