SwiftChart
SwiftChart copied to clipboard
Accessibility & VoiceOver support
Hello! Thanks for the library.
I noticed that currently, SwiftCharts isn't accessible to VoiceOver and other clients that use UIAccessibility. You can test this by turning on VoiceOver and running the example project, where it currently defaults to reading the X and Y axes labels.
This PR attempts to address this issue, by making the data contained in each chart accessible, using the UIAccessibilityContainer protocol. I've attempted to minimize changes to rendering and structure and have left comments describing additions. Changes are apparent when using the example project with VoiceOver running, otherwise there should be no visible changes. I've added 2 additional public properties: accessibilityXLabels
and accessibilityYLabels
. These allow the customization of labels to sound better to an audio interface. I've updated the StockChartsViewController to make use of both of them to demonstrate its effect.
Happy to make any changes!
I hope this will be merged, now I have the same task and will use this branch, thank you @mathewa6 !