Search code examples
iosswiftipadaccessibilityfull-keyboard-access

How to make Top View Controller receive focus with `tab` or `arrow` keys when using Full Keyboard Access


Question: Top View Controller (CardVC) not focusable with Full Keyboard Access

Issues:

  1. When CardVC is displayed, and if the Full Keyboard Access is enabled, the navigation by pressing Tab or Arrow buttons on external keyboard doesn't cycle back to the CardVC.
  2. Initially, CardVC is highlighted (blue border to represent the focus), but pressing space key on external keyboard doesn't result in tap event. Expected: Pressing space key should navigate to accounts settings.

Video Recording: dropbox link

View Hierarchy:

Base View Controller (Background view controller)

Card View Controller (Extended from UIViewController - custom height/width and has a gesture to dismiss upon tap on background BaseViewController)

Table view

Single cell with a button Switch Accounts.

enter image description here

Looked into:

Would welcome suggestions on how to approach Accessibility and full keyboard access related debugging.

Related:


Solution

  • TableViews with complicated cells are known to break the Full Keyboard Access as per the updated links in the question.

    Root cause of this issue: Cell has a button and few other views that conflicts with the focus.

    In order to resolve it, I had to simplify the cell to not contain the button Switch Accounts - this was added a few years back and caused the focus issue with Full Keyboard Access.

    Now the updated hierarchy is:

    Base View Controller (Background view controller)

    Card View Controller (Extended from UIViewController - custom height/width and has a gesture to dismiss upon tap on background BaseViewController)

    Table view

    Cell without the button switch accounts

    Switch Accounts button (Now on the same level as a sibling-view of tableView)