Mac Catalyst: UISplitViewControllerColumnSecondary doesn't get key focus when the Tab Key is Pressed in a Triple UISplitViewController.

My UISplitViewController is configured like this:

  1. A list (collection view) is used in the primary view controller (sidebar style).
  2. When a selection is made in the primary view controller a table view displays data in the supplementary column.
  3. When a selection is made in the supplementary view controller, a view controller with scrollable content is shown in the secondary view controller.

This is like the Mail app on Mac. So when I run the app I hit the tab key once and the list (collection view) in the primary column gets focus. I can navigate the list with the keyboard. This works as expected.

So now with a selection in the list, a table view is showing in the supplementary column. I hit the tab key again and the table view gets focus. This works as expected as I can navigate the table view from the keyboard with the arrow keys.

Now with a selection made in the table view, the scrollable view controller is showing in the secondary view controller column. I hit the tab key again and focus goes back to the list in the primary column. This is not the expected behavior. I'd expect hitting tab would move focus to the scroll view in the secondary column instead of jumping back to the primary column (as I should be able to scroll the scroll view in the secondary column with the up and down arrow keys). The user is then required to click on the secondary view controller in order to scroll it with the arrow keys. This breaks full keyboard navigation.

The behavior I'm after is actually the default behavior in the Mail app but I can't figure out how to get it to work in Mac Catalyst?

Oh my I just discovered that UIScrollView doesn't have any implementation at all for scrolling with the arrow keys. Guess I'll try to have to subclass and try to implement it myself....

It's hard to say what might be happening without a sample project, but — on the Mac — keyboard navigation is going to change first-responder, not focus. If your detail view has no views that accept first responder, then the Tab key isn't going to jump into the detail view. You could test this if you can add an editable text field to your detail view temporarily. In that case, I'd expect the Tab key to work as you'd expect.

I don't have a sample project with your exact configuration at hand, but I tried with the UIKit Catalog sample:

 https://developer.apple.com/documentation/uikit/mac_catalyst/uikit_catalog_creating_and_customizing_views_and_controls/

Depending what I selected there in the sidebar, I could (or could not) tab into the detail view, according to what was in the detail view.

Thanks a lot for the reply. I filed a feedback with a sample project and screen capture FB11745181.

In the sample project I used a plain UIScrollview. Tabbing into it doesn't work. After fiddling with the quick sample I noticed that arrow key scrolling doesn't work at all (even when clicking on the scroll view).

In the app I'm actually working on I'm using a WKWebView which does have arrow key scrolling implemented but was requiring at least a mouse click on the web view before it started working (couldn't tab in).

It's hard to say what might be happening without a sample project, but — on the Mac — keyboard navigation is going to change first-responder, not focus.

That's what I thought. I fiddled with calls to -becomeFirstResponder with no luck (on the view controller and on the web view itself).

Subclassing and returning YES from -canBecomeFocused on the view is all I needed to do to get focus to move over with the tab key, without messing with the responder chain at all. But I also needed to implement my own key commands to actually do the scrolling now because the default web view ones don't work after these overrides.

Mac Catalyst: UISplitViewControllerColumnSecondary doesn't get key focus when the Tab Key is Pressed in a Triple UISplitViewController.
 
 
Q