Accessibility testing
iOS
You can snapshot the accessibility elements of your apps by calling the modifier emergeAccessibility(true)
import SnapshotPreferences
struct MyComponent_Previews: PreviewProvider {
static var previews: some View {
MyView()
MyView()
.emergeAccessibility(true) // note: need to import SnapshotPreferences into your target
}
}
This will use AccessibilitySnapshot to visualize the accessibility elements on your view.
Updated 3 months ago