[英]accessibilityPerformMagicTap not called every time
I have tried override func accessibilityPerformMagicTap()
both within a particular view controller and within AppDelegate.swift我已经尝试在特定视图控制器和 AppDelegate.swift 中override func accessibilityPerformMagicTap()
When it works, it is great.当它起作用时,它很棒。 But it does not work in all situations.但它并不适用于所有情况。 The function in AppDelegate is called more often than the function in the ViewController, but still not every time the gesture is performed. AppDelegate 中的函数比 ViewController 中的函数被调用的次数更多,但仍然不是每次执行手势时。
Is there anything you can suggest I look into that may be causing the function not to be called in certain situations of my app's runtime when the gesture is performed?您是否可以建议我调查可能导致在执行手势时在我的应用程序运行时的某些情况下不调用该函数的任何内容?
Thank you!谢谢!
override func accessibilityPerformMagicTap() -> Bool {
print("magic tap performed in app delegate")
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "magicHappened"), object: nil)
return false
}
在我的测试中,magic tap 仅在您的应用程序当前存在“焦点”辅助功能元素时才有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.