UIAccessibilityPostNotification is used to change things (like focused elements but also pausing and resuming assistive technology like that:
UIAccessibility.post(notification: .pauseAssistiveTechnology, argument: UIAccessibility.AssistiveTechnologyIdentifier.notificationSwitchControl)
UIAccessibility.post(notification: .resumeAssistiveTechnology, argument: UIAccessibility.AssistiveTechnologyIdentifier.notificationSwitchControl)
It can also announce something:
UIAccessibility.post(notification: .announcement, argument: "Say something")
or refresh focus after accessibility scroll
UIAccessibility.post(notification: .pageScrolled, argument: nil)
On the other hand UIAccessibilityFocusedElement
can't change anything. It just returns currently focused element (or nil
) this way:
UIAccessibility.focusedElement(using: UIAccessibility.AssistiveTechnologyIdentifier.notificationVoiceOver)
On a side note - for now only assistive technology that can be paused or resumed is notificationSwitchControl, trying that with Voice Over causes crashes