This pull request is a sketch of what VoiceOver SwiftUI previews could look like.
Here are some decisions I made in this implementation:
Created a modifier that could be added on top of an existing preview so multiple previews were not needed. This means that a button must be pressed, or a binding must be set to true, to see the VoiceOver preview
Used the existing AccessibilitySnapshotView, including the snapshot of the content, rather than rendering the bounding boxes on top of the existing view
Placed the legend below the view that has been snapshotted
Here is a screen recording of the preview in action:
This pull request is a sketch of what VoiceOver SwiftUI previews could look like.
Here are some decisions I made in this implementation:
AccessibilitySnapshotView
, including the snapshot of the content, rather than rendering the bounding boxes on top of the existing viewHere is a screen recording of the preview in action:
https://github.com/cashapp/AccessibilitySnapshot/assets/1452879/67ecc3f9-8264-41f5-8bbc-bf6e0b450ed6