I added below codes on ViewController
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
print("started")
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
print("ended")
}
but it doesn't print any messages at all.
UIWindow, UIViewController, UIView are subclass of UIResponder
if you want to use
touchesBeganandtouchesEnded, override ittouch event follow responder chain refer apple docs
some touch event occur and your ViewController's view become next responder and hittest successfully
touchesBegancalled when touch began andtouchesEndedcalled touch ended