SwiftUI Full Keyboard Access

Viewed 283

I have a 2 part question:

  • I am implementing some custom controls and want to make sure they are correctly navigable when "Full Keyboard Access" is enabled in iOS settings. I am able to successfully navigate the UI with keyboard but I want to customise the focus UI. Currently it shows a blue background on the entire control but I would like to customise the look of the component that is currently in focus. The effect I am looking for is similar to what you can get with .accessibilityPath property in UIKit.
  • I am unable to test this on iOS Simulator (Xcode 12 and 13). Nothing happens when I turn the "Full Keyboard Access" on in simulator settings app. Is there a way to test this on simulator instead of the device?

Minimum Deployment target = iOS 13 Swift 5.0 Xcode 12 and 13

1 Answers

There is isFocused environment value, but it is only available on iOS 15. There is also accessibilityShowButtonShapes environment value that you need to check to highlight button borders.

Related