This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 252
Option to use usesDrawViewHierarchyInRect:afterScreenUpdates: #100
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21dbee5
to
64c54f4
Compare
64c54f4
to
70a4127
Compare
[bluredRedView addSubview:visualEffectView]; | ||
|
||
self.usesDrawViewHierarchyInRect = YES; | ||
FBSnapshotVerifyView(bluredRedView, nil); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You won't see on snapshot blur/vibrant effect if both view will have same frames.
I would recommend to change to:
UIView *redView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, 40)];
redView.backgroundColor = [UIColor redColor];
visualEffectView.frame = CGRectMake(0, 0, 40, 20);
UIView *parentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
[parentView addSubview:redView];
[parentView addSubview:visualEffectView];
Or something like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
c811e7d
to
02c6e46
Compare
02c6e46
to
5a93d5e
Compare
nscoding
pushed a commit
that referenced
this pull request
Jul 20, 2015
Option to use usesDrawViewHierarchyInRect:afterScreenUpdates:
This was referenced Jul 20, 2015
Caiopia
pushed a commit
to Shopify/ios-snapshot-test-case
that referenced
this pull request
Sep 24, 2019
Previously we would compare UIImage size properties, which are not in pixel units but scale-dependent points. This would cause issues if a test used reference images generated using .none fileNameOptions and ran tests on 2x or 3x simulators: they would fail early because of the size comparison because of the scale difference. This commit changes the logic to use CGImageGet{Width,Height} instead, which returns the actual pixel size (akin to use size * scale) and is backwards compatible since the image comparison code actually uses CGImage pixel retrieving methods.
Caiopia
pushed a commit
to Shopify/ios-snapshot-test-case
that referenced
this pull request
Sep 24, 2019
Added PR facebookarchive#100 as the first change that will make it into the next release.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There have been several cases (#70 #91 #92) where the view needs to be added in a visible
UIWindow
to display things correctly. Callingfb_imageForLayer:
withview.layer
is not enough in these cases.usesDrawViewHierarchyInRect
) will usedrawViewHierarchyInRect:afterScreenUpdates:
like Apple suggests here.UIWindow
if needed.