Accessibility state - iOS
On iOS, the accessibilityTraits
attribute can be used to indicate the accessibility state. The traits selected
and notEnabled
can be used to indicate the current state.
If your state is not selected
or notEnabled
, we recommended using the accessibilityValue
attribute to indicate the state.
element.accessibilityTraits = .selected
element.accessibilityTraits = .notEnabled
element.accessibilityValue = "Expanded"
element.accessibilityValue = "Collapsed"