`accessibilityElementDidBecomeFocused` only gets called with VoiceOver enabled on iPhone

Background

I have a UICollectionViewCell, where I override accessibilityElementDidBecomeFocused method. I also override canBecomeFocused to always return true. The App allows Accessibility->Full Keyboard Access (allowing the user to use the app with just Keyboard). isAccessibilityElement is also set to true for the collectionviewCell

Problem

I have two scenarios

  1. When both Keyboard access and VoiceOver are enabled In this case accessibilityElementDidBecomeFocused gets called as expected.

  2. When both Keyboard access is enabled but VoiceOver is disabled In this case accessibilityElementDidBecomeFocused isn't getting called.

Is this the expected behaviour? If yes, then is there a callback available when a view element gets focused via Keyboard with VoiceOver disabled?

Answered by Frameworks Engineer in 778361022

Hello! Full Keyboard Access (FKA) focus uses the UIKit focus system instead of responding to the accessibility focus APIs. You can check out API about UIFocusSystem here: https://developer.apple.com/documentation/uikit/uifocussystem

This WWDC21 session about keyboard navigation (different from FKA, but uses the same focus system) may be helpful, if you'd like to check it out https://developer.apple.com/wwdc21/10260

Accepted Answer

Hello! Full Keyboard Access (FKA) focus uses the UIKit focus system instead of responding to the accessibility focus APIs. You can check out API about UIFocusSystem here: https://developer.apple.com/documentation/uikit/uifocussystem

This WWDC21 session about keyboard navigation (different from FKA, but uses the same focus system) may be helpful, if you'd like to check it out https://developer.apple.com/wwdc21/10260

Thanks, I ended up using the didUpdateNotification to implement my own logic for Full Keyboard Access

`accessibilityElementDidBecomeFocused` only gets called with VoiceOver enabled on iPhone
 
 
Q