0

I have some issues with capturing user touch. I'm using an external library, which displays a map. The map stops answering touches after certain actions. I've subclassed UIWindow and replaced it in my AppDelegate (in a way presented below). It is working in general, and the breakpoint there stops execution when I touch the screen.

When map stops responding, the buttons still trigger the breakpoint, but tap/swipe/pinch on the map does nothing, even the breakpoint do not trigger. It acts like I've never touched the screen, and I thought UIWindow should always report the touch.

What can it indicate? What else to do to try to resolve the issue?

@objc class MyWindow : UIWindow {
    override func sendEvent(_ event: UIEvent) {
        print(event) // + breakpoint here
        super.sendEvent(event)
    }
}

and in AppDelegate:

- (MyWindow *)window {
    static MyWindow *myWindow = nil;
    if (!myWindow) {
        myWindow = [[MyWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    }
    return myWindow;
}
Nat
  • 12,032
  • 9
  • 56
  • 103
  • Perhaps [this](https://stackoverflow.com/a/8444281/1971013) works better? – meaning-matters Jul 05 '18 at 14:59
  • @meaning-matters Just tested it. Unfortunately, it's behaving completely the same as the method in `UIWindow` subclass. It is called when I tap on the buttons but is not called when I tap on the map, which is stuck. – Nat Jul 05 '18 at 15:33

0 Answers0