问题
I have a touchesBegan
method in my AppDelegate
. I use it to detect taps in the status bar. I've had it there for a long time and it's worked great. Until the iOS 13 betas came out...
Ever since using iOS 13 touchesBegan
has stopped being called. Nothing else related to gestures has changed in my app, nothing in my AppDelegate
has changed. I don't really have much to go on other than touchesBegan
is called in iOS 12 and not in iOS 13.
No luck so far though so I'm sharing this here in case someone else has had the same or a similar issue.
Update: 1
I have found the following issues which are semi related and have lead me to Apple's new UISceneDelegate in iOS 13. None of these issues explain why touchesBegan
isn't being called. And as I understand the UISceneDelegate
so far, I haven't yet found why touchesBegan
isn't being called.
View controller responds to app delegate notifications in iOS 12 but not in iOS 13
How to detect touches in status bar
iOS13: how to detect a status bar click event?
回答1:
I had the same issue recently. It took my several hours to figured it out. I've created another UIWindow on top of the main window to show app notifications/alerts. For some reason it eats all the touch actions when using ios 13. The workaround of mine is that just disable user interaction on the top one. But that means you can't do any user interaction with notifications/alerts obviously.
来源:https://stackoverflow.com/questions/57806710/touchesbegan-is-called-in-ios-12-but-is-not-called-in-ios-13