accessibilityValue(_:isEnabled:)
Adds a textual description of the value that the view contains.
Declaration
@export(implementation) nonisolated func accessibilityValue(_ valueResource: LocalizedStringResource, isEnabled: Bool) -> ModifiedContent<Content, Modifier>Parameters
- valueResource:
The accessibility value to apply.
- isEnabled:
If true the accessibility value is applied; otherwise the accessibility value is unchanged.
Discussion
Use this method to describe the value represented by a view, but only if that’s different than the view’s label. For example, for a slider that you label as “Volume” using accessibilityLabel(), you can provide the current volume setting, like “60%”, using accessibilityValue().