Speak Selection broken with SwiftUI text

I have users who need to be able to hear the content of SwiftUI Text views. I have specified the .textSelection(.enabled) modifier for the text views. Adding this modifier causes a "copy" option to appear on long press, but it doesn't enable the visible selection of text, nor does it provide the "Speak" menu item that UIKit allows on text selection.

Is the "Speak Selection" accessibility feature broken for SwiftUI Text views? I've found that there's another accessibility feature that does work (enabling the Speech Controller button for "Speak Screen"). Do I need to tell my users that Apple is deprecating the "Speak Selection" accessibility feature, and that they need to use the Speech Controller instead? Or is there something else I can do to my SwiftUI to get that feature to work?

Answered by Frameworks Engineer in 851027022

Speak Selection is not a deprecated accessibility feature, so it wouldn't make much sense for you to tell your users that. You are free to inform them of the many ways to use their device to speak text on the display for their own choice and flexibility.

Since you may be experiencing a bug, you should file a bug report using the Feedback Assistant tool. It's important that you share portions of your code, or a sample project if you wish to keep it streamlined, https://developer.apple.com/bug-reporting/

After you create your report, feel free to reply with the Feedback ID so I can make sure it gets in front of the right people.

Accepted Answer

Speak Selection is not a deprecated accessibility feature, so it wouldn't make much sense for you to tell your users that. You are free to inform them of the many ways to use their device to speak text on the display for their own choice and flexibility.

Since you may be experiencing a bug, you should file a bug report using the Feedback Assistant tool. It's important that you share portions of your code, or a sample project if you wish to keep it streamlined, https://developer.apple.com/bug-reporting/

After you create your report, feel free to reply with the Feedback ID so I can make sure it gets in front of the right people.

Speak Selection broken with SwiftUI text
 
 
Q