Skip to content

Commit

Permalink
Fix topBar button colors on iOS 13
Browse files Browse the repository at this point in the history
  • Loading branch information
yogevbd committed Nov 26, 2019
1 parent 6f13d69 commit 9f43bca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/ios/UIImage+tint.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
@implementation UIImage (tint)

- (UIImage *)withTintColor:(UIColor *)color {
UIImage *newImage = [self imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000

This comment has been minimized.

Copy link
@balbirsng

balbirsng Nov 27, 2019

this check is required; otherwise the library is not usable in xcode < 11.

This comment has been minimized.

Copy link
@guyca

guyca Nov 27, 2019

Collaborator

Hey @balbirsng, we've published this change as a major version. Starting with version 4.0.0 - we've only supporting xcode 11

This comment has been minimized.

Copy link
@balbirsng

balbirsng Nov 27, 2019

Thanks for the update @guyca. As this is the only code which requires iOS 13 I don't see any reason to add a restriction of it.

if (@available(iOS 13.0, *)) {
return [newImage imageWithTintColor:color];
return [self imageWithTintColor:color renderingMode:UIImageRenderingModeAlwaysOriginal];
}
#endif

UIImage *newImage = [self imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
UIGraphicsBeginImageContextWithOptions(self.size, NO, newImage.scale);
[color set];
[newImage drawInRect:CGRectMake(0, 0, self.size.width, newImage.size.height)];
Expand Down

0 comments on commit 9f43bca

Please sign in to comment.