|
|
|
|
4
|
|
4
|
|
5
|
- (UIImage *)withTintColor:(UIColor *)color {
|
5
|
- (UIImage *)withTintColor:(UIColor *)color {
|
6
|
UIImage *newImage = [self imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
|
6
|
UIImage *newImage = [self imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
|
|
|
7
|
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
|
|
|
8
|
+ if (@available(iOS 13.0, *)) {
|
|
|
9
|
+ return [newImage imageWithTintColor:color];
|
|
|
10
|
+ }
|
|
|
11
|
+#endif
|
7
|
UIGraphicsBeginImageContextWithOptions(self.size, NO, newImage.scale);
|
12
|
UIGraphicsBeginImageContextWithOptions(self.size, NO, newImage.scale);
|
8
|
[color set];
|
13
|
[color set];
|
9
|
[newImage drawInRect:CGRectMake(0, 0, self.size.width, newImage.size.height)];
|
14
|
[newImage drawInRect:CGRectMake(0, 0, self.size.width, newImage.size.height)];
|