触屏类四个方法:
image.png
class ViewController:UIViewController { override func viewDidLoad() { super.viewDidLoad() } override func touchesBegan(_ touches:Set<UITouch>,with event:UIEvent?) { print(“touchesBegan”); } override func touchesMoved(_ touches:Set<UITouch>, with event:UIEvent?) { print(“touchesMoved”); } override func touchesEnded(_ touches:Set<UITouch>,with event:UIEvent?){ print(“touchesEnded”); } override func touchesCancelled(_ touches:Set<UITouch>, with event:UIEvent?) { print(“touchesCancelled”); } }