简体   繁体   English

每次都不会调用accessibilityPerformMagicTap

[英]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.

相关问题 每次调用ViewdidLoad - ViewdidLoad called every time 在UIPageViewController中并非每次都调用viewControllerBeforeViewController - viewControllerBeforeViewController is not called every time in UIPageViewController 每隔一次调用UITextField shouldBeginEditing? - UITextField shouldBeginEditing called every other time? 实际上,每次有segue转换时都会调用viewDidLoad - viewDidLoad is in fact called every time there is a segue transition 每次点击屏幕都会调用NSNotification - NSNotification is called every time I tap the screen 在UIImagePickerController()的dismiss()之后每次调用viewDidLoad()。 - viewDidLoad() is called every time after dismiss() of UIImagePickerController() viewDidLoad中的代码每次调用时都会运行 - Code in viewDidLoad runs every time it is called iOS canAuthenticateAgainstProtectionSpace方法每次都不会调用 - iOS canAuthenticateAgainstProtectionSpace method not called every time 每次应用启动时都会调用 WKWebView 请求 DeviceMotion 和 DeviceOrientation 的权限 - WKWebView Request permission for DeviceMotion and DeviceOrientation is called every time app launches 为什么每次选择另一个TextField时都会调用UIKeyboardWillShowNotification? - Why is UIKeyboardWillShowNotification called every time another TextField is selected?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM