UIAccessibilityElement
An element that should be accessible to users with disabilities, but that isn’t accessible by default.
Declaration
@MainActor class UIAccessibilityElementMentioned in
Overview
You can use UIAccessibilityElement to provide information about an icon or text image that isn’t automatically accessible because it doesn’t inherit from UIView (or UIControl). A view that contains such nonview items creates an instance of UIAccessibilityElement to represent each item that needs to be accessible.
The properties of an accessibility element provide information about the element, such as location and current value, to an assistive application. You might need to set an element’s property even if you don’t need to create an instance of UIAccessibilityElement to represent it. For example, if your app includes a button with a custom icon that means “solve,” the button itself is already represented by an accessibility element because it’s a subclass of UIButton. However, you need to supply information for the label and hint properties because this information is unique to this button. You can do this in Interface Builder or by setting the properties in the UIAccessibility informal protocol.