Post

Replies

Boosts

Views

Activity

.accessibilityLabel(Text(someAttributedString)) no longer enables links rotor in iOS17
Hey all, I was hoping to find a solution to this issue with voiceover and if there isn't one then raise a radar as it may be a bug. Across our app, we have some SwiftUI.Text elements that are set with AttributedString (Text(someAttributedString)) and can contain one or more links. When no custom .accessibilityLabel is set on the Text, when that element is focused on with voiceover, the text is read, any links within the text read "link" after, and when the text finishes reading, "Use the rotor to access links" is read, the rotor has a "Links" option, and selecting that rotor option will allow the links within that AttributedString to be selected and opened. All good! However, we have some instances where we want slightly modified versions of that AttributedString to be used for the accessibility label, for example when we want to fix pronunciation of certain brand or non standard words. To do this, we have something like: Text(someAttributedString) .accessibilityLabel(Text(someModifiedAttributedString)) Although this originally worked and read out the "link", "Use the rotor to access links", and links could be focused and selected, this no longer seems to work. "link" will still be read out after the link portion of the text, but "Use the rotor to access links" will not be, and the "Links" option won't be available on the rotor. I believe this issue was introduced with the iOS17 SDK/Xcode 15. Has the API changed and theres something else we need to set here? Or is this a bug with the iOS 17 SDK? Thanks!
0
1
568
Dec ’23