Skip to content

Commit 4666c29

Browse files
authored
Merge pull request changwoolab#2 from changwoolab/bugfix/ios-17
fix: Removed depreciated UIGraphicsBeginImageContextWithOptions
2 parents f411c51 + 0f49aaa commit 4666c29

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ios/FastImage/FFFastImageView.mm

+5-5
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ - (void) setImageColor: (UIColor*)imageColor {
7373

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

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "react-native-fast-image",
3-
"version": "8.6.3",
2+
"name": "@changwoolab/react-native-fast-image",
3+
"version": "8.6.4",
44
"description": "🚩 FastImage, performant React Native image component.",
55
"keywords": [
66
"cache",

0 commit comments

Comments
 (0)