You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have no idea how feasible it would be to build this, given the requirement for hosted tests, but I'd love if I could wrap my SwiftUI previews in some utility from this library that would let me see my accessibility labels alongside my view while developing, instead of after the fact when snapshot testing.
The text was updated successfully, but these errors were encountered:
My understanding is previews are rendered in a host app, so I don't think that would be a problem. One other requirement is the container needs to be added to a window so it can convert to the screen coordinate space. I'm guessing previews would need to use a window. The setup code would look something like this:
#Preview {letcontainer=AccessibilitySnapshotView(
containedView: theViewYouWantToSnapshot,
viewRenderingMode:.drawHierarchyInRect,
activationPointDisplayMode:.whenOverridden
)
// This part should run once the container is added to a window:
try container.parseAccessibility(useMonochromeSnapshot: true)
container.sizeToFit()return container
}
Maybe we could wrap the AccessibilitySnapshotView inside another container that calls the parse method when it's added to a window? I'm not really sure what the life cycle for a preview is.
I have no idea how feasible it would be to build this, given the requirement for hosted tests, but I'd love if I could wrap my SwiftUI previews in some utility from this library that would let me see my accessibility labels alongside my view while developing, instead of after the fact when snapshot testing.
The text was updated successfully, but these errors were encountered: