A way to intercept any touches of your application is to create a custom UIWindow which will catch the touches without canceling them.
class CustomWindow: UIWindow {
override func pointInside(point: CGPoint, withEvent event: UIEvent?) -> Bool {
// Do any action you would like to perform to indicate the application is active
return false
}
}
You have to add this window in your Application Delegate, and set its level above the main window.
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var topWindow: CustomWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
topWindow = CustomWindow(frame: UIScreen.mainScreen().bounds)
topWindow?.rootViewController = UIViewController()
topWindow?.windowLevel = UIWindowLevelNormal + 1
topWindow?.hidden = false
return true
}