Skip to content

Commit

Permalink
fix: Remove deprecated UIGraphicsBeginImageContextWithOptions
Browse files Browse the repository at this point in the history
related issue: DylanVann#1010
  • Loading branch information
pierguinzani authored Jan 12, 2024
1 parent 9ab80fc commit 942dd2b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ios/FastImage/FFFastImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ - (void) setImageColor: (UIColor*)imageColor {

- (UIImage*) makeImage: (UIImage*)image withTint: (UIColor*)color {
UIImage* newImage = [image imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate];
UIGraphicsBeginImageContextWithOptions(image.size, NO, newImage.scale);
[color set];
[newImage drawInRect: CGRectMake(0, 0, image.size.width, newImage.size.height)];
newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:image.size];
newImage = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {
[color setFill];
[newImage drawInRect:CGRectMake(0, 0, image.size.width, newImage.size.height)];
}];
return newImage;
}

Expand Down

0 comments on commit 942dd2b

Please sign in to comment.