func makeChartDescriptor () -> AXChartDescriptor
AXChartDescriptor
for this view, and return it.func updateChartDescriptor (AXChartDescriptor )
AXChartDescriptor
for your view, based on changes in your view or in the Environment
.AXChartDescriptor
object that you use to provide information about a chart and its data for an accessible experience in VoiceOver or other assistive technologies.Availability 有効性
Technology
protocol AXChartDescriptorRepresentable
Note that you may use the @Environment
property wrapper inside the implementation of your AXChart
, in which case you should implement update
, 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 AXChart
type to your view using the accessibility
modifier:
var body: some View { MyChartView() .accessibilityChartDescriptor(MyChartDescriptorRepresentable()) }
func makeChartDescriptor () -> AXChartDescriptor
AXChartDescriptor
for this view, and return it.func updateChartDescriptor (AXChartDescriptor )
AXChartDescriptor
for your view, based on changes in your view or in the Environment
.func accessibilityChartDescriptor <R>(R) -> some View