I know you can detect touches using touchesBegan, touchesEnded, etc. These all work. The only thing is that they only detect the touches on the view itself, not on anything on t
You can add this to your AppDelegate:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let tapGesture = UITapGestureRecognizer(target: self, action: nil)
tapGesture.delegate = self
window?.addGestureRecognizer(tapGesture)
return true
}
func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldReceiveTouch touch: UITouch) -> Bool {
// User tapped on screen, do whatever you want to do here.
return false
}
And also make your AppDelegate conform to UIGestureRecognizerDelegate protocol.