Reputation: 621
How to force voice over in Accessibility read my updated label
For example,
var label.text = 1
Then after 2 sec I update label to 2
label.text = 2
But the voice over not interact with 2
any suggest ?
Upvotes: 0
Views: 3376
Reputation: 2354
UIAccessibility.post(notification: .layoutChanged, argument: label)
Upvotes: 2
Reputation: 20609
If the question you're asking is, "How do I alert the user to a change in content," you can choose among three solutions.
UIAccessibilityNotification(UIAccessibilityLayoutChangedNotification, label)
to notify the system that the content has changed and force focus to the label.UIAccessibilityNotification(UIAccessibilityAnnouncementNotification, "Your announcement")
to request that the system communicate the string to the user.UIAccessibilityTraitUpdatesFrequently
trait to your label. The system will periodically announce changes to the content.Upvotes: 3