snapshot containing SwiftUI liquid glass effect is fully transparent #1031
Replies: 4 comments
-
|
+1 |
Beta Was this translation helpful? Give feedback.
-
|
@lukaskollmer @ibrahimFever Snapshotting views with effects (like liquid glass) requires an application test host and explicit enabling of the |
Beta Was this translation helpful? Give feedback.
-
|
Woks with a HostApp and drawing using drawHierarchyInKeyWindow. This is a bummer actually, because we rely basically on system components in our component swift package. So testing will always need a snapshot host app now with Liquid Glass around because now most of the UI elements will have am effect applied. |
Beta Was this translation helpful? Give feedback.
-
|
It's a bummer, but sadly just how Apple's tools work, and there's not much we can do about it. Since this isn't an issue with the library I am going to convert it to a discussion. Please feel free to continue the conversation over there! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
snapshot-testing a SwiftUI view that contains a glass effect always results in a fully transparent snapshot image.
To Reproduce
of the two resulting images,
example.1.pngis correct, butexample.2.pngis just a transparent PNG.Expected behavior
the view containing a glass effect should still render correctly.
Environment
Additional context
#1019 is very likely a closely related bug, but i'm not sure if it's the same since
UIEffectViewwhereas the example here is pure SwiftUI (which, looking at the specific view hierarchy at runtime, doesn't seem to be using anyUIEffectViews...)Beta Was this translation helpful? Give feedback.
All reactions