As I said in the comments, subclass UIApplicationand override the instance method sendEvent:.
From the documentation for the UIApplication class, method -sendEvent::
Discussion
If you need it, you can intercept incoming events by subclassing UIApplication and overriding this method. For each event you intercept, you must send it by calling [super sendEvent: event] after processing the event in your implementation.
, :
CustomUIApplication.h:
@interface CustomUIApplication:UIApplication
- (void)sendEvent:(UIEvent *)event;
@end
CustomUIApplication.m:
@implementation CustomUIApplication
- (void)sendEvent:(UIEvent *)event
{
[super sendEvent:event];
}
@end
, , UIApplication. , Objective-C, , Swift.