简体   繁体   中英

accessibilityPerformMagicTap not called every time

I have tried override func accessibilityPerformMagicTap() both within a particular view controller and within AppDelegate.swift

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.

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 仅在您的应用程序当前存在“焦点”辅助功能元素时才有效。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM