How to implement Look-To-Dictate on visionOS?

Hello everyone!

I noticed that the UISearchBar on visionOS automatically supports the Look-To-Dictate function. However, for a regular UITextView, I couldn't find the corresponding API. How can I make a UITextView support the Look-To-Dictate function? This is a great system feature.

(I noticed there is a protocol called UILookToDictateCapable but no idea how to use it.)

UISearchBar is the only type that conforms to UILookToDictateCapable currently so you can only set isLookToDictateEnabled on a search bar, not a text view. It’s false by default for iOS apps but you can enable it so people using your app as-is on visionOS can use that feature.

How to implement Look-To-Dictate on visionOS?
 
 
Q