Incorrect behaviour when trying to change focus to a focused view inside UIPageViewController

We are experiencing difficulties with keyboard navigation focus within a view contained inside a UIPageViewController. The intended keyboard navigation sequence does not function as expected.

Expected Behavior:

  1. Pressing the Tab key once should move the focus to the UIPageViewController, allowing the use of the Up and Down arrow keys to navigate between pages.
  2. Pressing the Tab key a second time should shift the focus outside the UIPageViewController
  3. Pressing the Tab key a third time should move the focus back to the UIPageViewController.

Actual Behavior: The focus does not shift as described above.

Have sent a sample Xcode project to Apple demonstrating the issue (unfortunately it doesn't allow me to attach the zipped project here for some reason).

STEPS TO REPRODUCE

  • Set a breakpoint at viewDidAppear (line 44, MyViewController)
  • Run the app, wait until it stops, and run the command in the lldb debugger

Command:

po UIFocusDebugger.checkFocusability(for: pager.viewControllers!.first!.view.subviews.first!)

Output:

The following issues were found that would prevent this item from being focusable:
- ISSUE: One or more ancestors have issues that may be preventing this item from being focusable. Details:
<_UIQueuingScrollView: 0x104826a00>:
- ISSUE: This view returns YES from -canBecomeFocused, which will prevent its subviews from being focusable.
<_UIPageViewControllerContentView: 0x103d07be0>:
- ISSUE: This view returns YES from -canBecomeFocused, which will prevent its subviews from being focusable.

@surutodi You should be able to share a link a test project here. Please see Creating a test project. Once you do, I'll be able to investigate that further.

Hello, sorry for the late response. Here is the link to the sample project.

Thanks

Incorrect behaviour when trying to change focus to a focused view inside UIPageViewController
 
 
Q