Skip to content

Commit

Permalink
Remove deprecated api
Browse files Browse the repository at this point in the history
  • Loading branch information
numsu committed Aug 22, 2023
1 parent fed19a4 commit fc2b8ac
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions ios/FastImage/FFFastImageView.m
Expand Up @@ -83,12 +83,17 @@ - (void)setBlurRadius:(CGFloat)blurRadius {

- (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();
return newImage;

UIGraphicsImageRendererFormat *format = [UIGraphicsImageRendererFormat defaultFormat];
UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:image.size format:format];

UIImage *resultImage = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {
CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height);
[color set];
[newImage drawInRect:rect];
}];

return resultImage;
}

- (void) setImage: (UIImage*)image {
Expand Down

0 comments on commit fc2b8ac

Please sign in to comment.