diff --git a/packages/rn-tester/RCTTest/FBSnapshotTestCase/UIImage+Diff.m b/packages/rn-tester/RCTTest/FBSnapshotTestCase/UIImage+Diff.m index 5713d4b74c5ef8..178f988fa595c3 100644 --- a/packages/rn-tester/RCTTest/FBSnapshotTestCase/UIImage+Diff.m +++ b/packages/rn-tester/RCTTest/FBSnapshotTestCase/UIImage+Diff.m @@ -21,15 +21,16 @@ - (UIImage *)diffWithImage:(UIImage *)image UIGraphicsImageRenderer *const renderer = [[UIGraphicsImageRenderer alloc] initWithSize:imageSize format:rendererFormat]; - return [renderer imageWithActions:^(UIGraphicsImageRendererContext *_Nonnull context) { + return [renderer imageWithActions:^(UIGraphicsImageRendererContext *_Nonnull rendererContext) { + const CGContextRef context = rendererContext.CGContext; [self drawInRect:CGRectMake(0, 0, self.size.width, self.size.height)]; - CGContextSetAlpha(context.CGContext, 0.5f); - CGContextBeginTransparencyLayer(context.CGContext, NULL); + CGContextSetAlpha(context, 0.5f); + CGContextBeginTransparencyLayer(context, NULL); [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)]; - CGContextSetBlendMode(context.CGContext, kCGBlendModeDifference); - CGContextSetFillColorWithColor(context.CGContext, [UIColor whiteColor].CGColor); - CGContextFillRect(context.CGContext, CGRectMake(0, 0, self.size.width, self.size.height)); - CGContextEndTransparencyLayer(context.CGContext); + CGContextSetBlendMode(context, kCGBlendModeDifference); + CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor); + CGContextFillRect(context, CGRectMake(0, 0, self.size.width, self.size.height)); + CGContextEndTransparencyLayer(context); }]; }