my view controller has a UITextView whose attributedText I’m setting with a function that returns an NSAttributedString because a range of that string needs to be a link. I then attempt to set my accessibilityLabel to something different from that text as well as the trait to .link.
let textView = UITextView()
textView.attributedText = generateCustomAttributedText() // Contains link formatting
textView.isEditable = false
textView.isSelectable = true
textView.isScrollEnabled = false
textView.backgroundColor = .clear
textView.textContainerInset = .zero
textView.textContainer.lineFragmentPadding = 0
textView.isAccessibilityElement = true
textView.accessibilityElements = nil
textView.accessibilityLabel = "Tap to learn more about accessibility features."
textView.accessibilityTraits = .link
With this I’m expecting voiceover to read “Tap to learn more about accessibility features., Link” but instead voiceover is reading, “Tap to learn more about accessibility features., , Group”
What do I need to do to get voiceover to read my expected response?