Posts

Post not yet marked as solved
0 Replies
393 Views
Is there a way to write tests that verify behavior of an iPadOS (non-Catalyst) app upon pressing one of the keys associated with UIKeyCommands? typeText throws the neither element nor any descendant has keyboard focus error, which makes sense since these keys are not meant to be typed into a text field. typeKey(_:modifierFlags:) isn't available according to Xcode. Anything else that I can try? Thank you.
Posted
by thgh.
Last updated
.
Post marked as solved
7 Replies
1.1k Views
Hello. I'd like to improve my keyboard focus experience on iPad in one of the usage scenarios of my app - browsing through two UICollectionViews in a master-detail pattern. I am able to navigate the master collection view with the arrow keys, and focus is indicated correctly; however, after selecting an item with the keyboard, which pushes the detail collection view on the same navigation stack, the focus indicator disappears and the following message appears in the console: [UIFocus] Starting to defer focus updates. followed by a symbolicated stack trace. At this point, the user has to tap one of the arrow keys so that the focus indicator reappears. In this case, if the user then exits the detail collection view, which reveals the master collection view, the item that was focused and selected on the master collection view will be indicated correctly. The console shows the following message: [UIFocus] Disabling focus deferral. followed once again by a symbolicated stack trace. Interestingly, the focus indicator also disappears after a period of time if the user leaves the app open and does not interact with it. In that case, the same message about starting to defer focus updates will appear, and the subsequent stack trace will contain an __NSFireTimer frame. My question would be - what are the criteria for focus deferral and how can I control its behavior? Thank you. Please let me know if I can add any relevant details to this thread.
Posted
by thgh.
Last updated
.