UIGestureRecognizer 中的 Touch 手势

想要识别UIGestureRecognizer本身的 touchesBegan、touchesMoved、touchesEnded、touchesEnded。

需要自定义 UIGestureRecognizer 的同时,
导入 import UIKit.UIGestureRecognizerSubclass就可以了。

import UIKit
import UIKit.UIGestureRecognizerSubclass

class GestureRecognizer: UIGestureRecognizer {

    override func touchesBegan(_ touches: Set, with event: UIEvent) {
        <#code#>
    }
    
    override func touchesMoved(_ touches: Set, with event: UIEvent) {
        <#code#>
    }
    
    override func touchesEnded(_ touches: Set, with event: UIEvent) {
        <#code#>
    }
    
    override func touchesEnded(_ touches: Set, with event: UIEvent) {
        <#code#>
    }
    
}

你可能感兴趣的:(UIGestureRecognizer 中的 Touch 手势)