IOS UIResponder 触屏

触屏类四个方法:


image.png

class ViewController:UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
override func touchesBegan(_ touches:Set,with event:UIEvent?) {
print(“touchesBegan”);
}
override func touchesMoved(_ touches:Set, with event:UIEvent?) {
print(“touchesMoved”);
}
override func touchesEnded(_ touches:Set,with event:UIEvent?){
print(“touchesEnded”);
}
override func touchesCancelled(_ touches:Set, with event:UIEvent?) {
print(“touchesCancelled”);
}
}

你可能感兴趣的:(IOS UIResponder 触屏)