-
Notifications
You must be signed in to change notification settings - Fork 608
Snapshot has incorrect corner mask when using layer.maskedCorners
#358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Shootin' from the hip a little bit here, but I wonder if this has anything to do w/ the
(line 716 of View.swift) If you explore the CALayer
Maybe this warning has something to do with it? Alternatively, I haven't yet tried the |
Going a little further, I found docs for
Emphasis added ^^ |
Is there any solution/workaround? |
Facing the same problem. Is there any workaround? |
Same here |
Did anyone find any solution or workaround for this? I'm facing the same issue. |
Won't add a lot of value here, just saying I face the same issue overthere |
As someone brought up previously in this issue, I believe you may need to introduce a host application and set |
@stephencelis I took a crack at this and I think I've verified that using I think another possible alternative is to try a
At any rate, here's a sample project with a Unit Test target whose host application is the main app target: https://github.com/chefnobody/snapshot-masked-corners And a screenshot of the results.
|
@chefnobody |
@domagojstankovic Be careful with this. |
@Nikoloutsos you are right, it didn't work when testing on CI so we had to remove those tests. Thank you for mentioning it anyway! |
@chefnobody thanks for suggest of drawHierarchy method |
Thanks for an awesome library! I've been enjoying it immensely since adding to my projects last week 🙌
I'm not sure if this is a UIKit issue or a SnapshotTesting issue, but I get an incorrect snapshot when using
CALayer
'smaskedCorners
property (introduced in iOS 11)e.g.
This should produce a blue rectangle with the bottom two corners rounded, but instead produces the image as if
maskedCorners
was not applied.Result:

The text was updated successfully, but these errors were encountered: