Skip to content

Commit

Permalink
fix: ios 17 crash
Browse files Browse the repository at this point in the history
  • Loading branch information
sterlingwes committed Oct 8, 2023
1 parent f337e56 commit cb861af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions ios/FastImage/FFFastImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,16 @@ - (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();
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@masterhealth-technologies/react-native-fast-image",
"version": "8.7.5",
"version": "8.7.6",
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
Expand Down

0 comments on commit cb861af

Please sign in to comment.