-1

I have a UILabel that changes text when a button is clicked at the bottom of the screen and certain conditions are met. I want my voice-over to read that updated text when a button is clicked and the conditions are met. How do I do that

Nari
  • 333
  • 5
  • 13

1 Answers1

1

You can post a notification to the accessibility system to get the behavior you're looking for. The following command specifically will shift focus to that label, effectively the same as if the user had tapped the label after activating the button. Read up on the other notification types if you want different behavior.

UIAccessibility.post(notification: .layoutChanged, argument: labelThatChanged)

Jamie A
  • 881
  • 1
  • 6
  • 14