One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

AXChartDescriptorRepresentable

protocol · iOS 15.0+ · SDK 27.1

protocol AXChartDescriptorRepresentable

A type to generate an `AXChartDescriptor` object that you use to provide information about a chart and its data for an accessible experience in VoiceOver or other assistive technologies. Note that you may use the `@Environment` property wrapper inside the implementation of your `AXChartDescriptorRepresentable`, in which case you should implement `updateChartDescriptor`, which will be called when the `Environment` changes. For example, to provide accessibility for a view that represents a chart, you would first declare your chart descriptor representable type: struct MyChartDescriptorRepresentable: AXChartDescriptorRepresentable { func makeChartDescriptor() -> AXChartDescriptor { // Build and return your `AXChartDescriptor` here. } func updateChartDescriptor(_ descriptor: AXChartDescriptor) { // Update your chart descriptor with any new values. } } Then, provide an instance of your `AXChartDescriptorRepresentable` type to your view using the `accessibilityChartDescriptor` modifier: var body: some View { MyChartView() .accessibilityChartDescriptor(MyChartDescriptorRepresentable()) }

Members (1)

method · iOS 15.0+

updateChartDescriptor

Swift declaration
func updateChartDescriptor(_ descriptor: AXChartDescriptor)

Update the existing `AXChartDescriptor` for your view, based on changes in your view or in the `Environment`. This will be called as needed, when accessibility needs your `AXChartDescriptor` for VoiceOver. It will only be called if the inputs to your views, or a relevant part of the `Environment`, have changed.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →