Skip to content

Commit

Permalink
Updated for iOS 13. Tweaked dark mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasgomollon committed May 5, 2020
1 parent 2902ef3 commit b1694a3
Show file tree
Hide file tree
Showing 32 changed files with 692 additions and 784 deletions.
39 changes: 11 additions & 28 deletions AppSales.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
4509175323CF7E990028AF83 /* About_dark.html in Resources */ = {isa = PBXBuildFile; fileRef = 4509175223CF7E990028AF83 /* About_dark.html */; };
4509175523CFBD1A0028AF83 /* ReviewTemplate_dark.html in Resources */ = {isa = PBXBuildFile; fileRef = 4509175423CFBD1A0028AF83 /* ReviewTemplate_dark.html */; };
4509175A23D030130028AF83 /* DarkModeCheck.m in Sources */ = {isa = PBXBuildFile; fileRef = 4509175923D030130028AF83 /* DarkModeCheck.m */; };
45C2B2222460296200C84374 /* csv_dark.css in Resources */ = {isa = PBXBuildFile; fileRef = 45C2B2202460296200C84374 /* csv_dark.css */; };
45C2B2232460296200C84374 /* csv.css in Resources */ = {isa = PBXBuildFile; fileRef = 45C2B2212460296200C84374 /* csv.css */; };
4509175A23D030130028AF83 /* DarkModeCheck.m in Sources */ = {isa = PBXBuildFile; fileRef = 4509175923D030130028AF83 /* DarkModeCheck.m */; };
45C2B2232460296200C84374 /* csv.css in Resources */ = {isa = PBXBuildFile; fileRef = 45C2B2212460296200C84374 /* csv.css */; };
62E09F1B19E693F3002917FE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 62E09F1A19E693F3002917FE /* Images.xcassets */; };
6D81575414CB3C2B005E8F3F /* KKKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D81574914CB3C2B005E8F3F /* KKKeychain.m */; };
6D81575514CB3C2B005E8F3F /* KKPasscodeLock.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D81574B14CB3C2B005E8F3F /* KKPasscodeLock.m */; };
Expand All @@ -25,7 +22,6 @@
7F0B8A6913F77F95006E9151 /* PromoCodeOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F0B8A6813F77F95006E9151 /* PromoCodeOperation.m */; };
7F0B8A6E13F7B941006E9151 /* PromoCode.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F0B8A6D13F7B941006E9151 /* PromoCode.m */; };
7F0B8A7313F7E647006E9151 /* PromoCodesLicenseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F0B8A7213F7E647006E9151 /* PromoCodesLicenseViewController.m */; };
7F0BF5D413D3154F0063A6B0 /* TopBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = 7F0BF5D313D3154F0063A6B0 /* TopBackground.png */; };
7F0BF5DA13D3317D0063A6B0 /* ShadowTop.png in Resources */ = {isa = PBXBuildFile; fileRef = 7F0BF5D813D3317D0063A6B0 /* ShadowTop.png */; };
7F0BF5DB13D3317D0063A6B0 /* ShadowBottom.png in Resources */ = {isa = PBXBuildFile; fileRef = 7F0BF5D913D3317D0063A6B0 /* ShadowBottom.png */; };
7F137EB313DDDABF004655D8 /* CountryDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F137EB213DDDABF004655D8 /* CountryDictionary.m */; };
Expand Down Expand Up @@ -128,12 +124,9 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
4509175223CF7E990028AF83 /* About_dark.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = About_dark.html; sourceTree = "<group>"; };
4509175423CFBD1A0028AF83 /* ReviewTemplate_dark.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = ReviewTemplate_dark.html; sourceTree = "<group>"; };
4509175823D030130028AF83 /* DarkModeCheck.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DarkModeCheck.h; sourceTree = "<group>"; };
4509175923D030130028AF83 /* DarkModeCheck.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DarkModeCheck.m; sourceTree = "<group>"; };
45C2B2202460296200C84374 /* csv_dark.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = csv_dark.css; sourceTree = "<group>"; };
45C2B2212460296200C84374 /* csv.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = csv.css; sourceTree = "<group>"; };
4509175823D030130028AF83 /* DarkModeCheck.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DarkModeCheck.h; sourceTree = "<group>"; };
4509175923D030130028AF83 /* DarkModeCheck.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DarkModeCheck.m; sourceTree = "<group>"; };
45C2B2212460296200C84374 /* csv.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = csv.css; sourceTree = "<group>"; };
62E09F1A19E693F3002917FE /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = AppSales/Images.xcassets; sourceTree = "<group>"; };
6D81574814CB3C2B005E8F3F /* KKKeychain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KKKeychain.h; sourceTree = "<group>"; };
6D81574914CB3C2B005E8F3F /* KKKeychain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KKKeychain.m; sourceTree = "<group>"; };
Expand All @@ -156,7 +149,6 @@
7F0B8A6D13F7B941006E9151 /* PromoCode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PromoCode.m; sourceTree = "<group>"; };
7F0B8A7113F7E647006E9151 /* PromoCodesLicenseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromoCodesLicenseViewController.h; sourceTree = "<group>"; };
7F0B8A7213F7E647006E9151 /* PromoCodesLicenseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = PromoCodesLicenseViewController.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
7F0BF5D313D3154F0063A6B0 /* TopBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = TopBackground.png; sourceTree = "<group>"; };
7F0BF5D813D3317D0063A6B0 /* ShadowTop.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ShadowTop.png; sourceTree = "<group>"; };
7F0BF5D913D3317D0063A6B0 /* ShadowBottom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ShadowBottom.png; sourceTree = "<group>"; };
7F137EB113DDDABF004655D8 /* CountryDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountryDictionary.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -489,12 +481,9 @@
7FAB533313DD0F9A0027274F /* country_names.plist */,
7FDF6E8013D8962500B8CC4E /* countries.plist */,
7FDF6E8213D89B1000B8CC4E /* countries_simple.plist */,
45C2B2212460296200C84374 /* csv.css */,
7F26DF9313E1358B001D0F33 /* ReviewTemplate.html */,
4509175423CFBD1A0028AF83 /* ReviewTemplate_dark.html */,
7FAEB68E13E75AFF00750788 /* About.html */,
4509175223CF7E990028AF83 /* About_dark.html */,
45C2B2202460296200C84374 /* csv_dark.css */,
45C2B2212460296200C84374 /* csv.css */,
7FAEB68E13E75AFF00750788 /* About.html */,
);
name = "Supporting Files";
path = Support;
Expand All @@ -512,7 +501,6 @@
DAD39BA61EEC9B3100CB3524 /* [email protected] */,
7F0BF5D813D3317D0063A6B0 /* ShadowTop.png */,
7F0BF5D913D3317D0063A6B0 /* ShadowBottom.png */,
7F0BF5D313D3154F0063A6B0 /* TopBackground.png */,
);
name = Images;
path = ../Images;
Expand Down Expand Up @@ -632,14 +620,14 @@
children = (
DAF2D89B203B5F8100F3C0CF /* ASProgressHUD.h */,
DAF2D89C203B5F8100F3C0CF /* ASProgressHUD.m */,
4509175823D030130028AF83 /* DarkModeCheck.h */,
4509175923D030130028AF83 /* DarkModeCheck.m */,
7F1499C813BE15F500D89064 /* NSData+Compression.h */,
7F1499C913BE15F500D89064 /* NSData+Compression.m */,
7F454F9E13D5C24F00AE47D1 /* UIColor+Extensions.h */,
7F454F9F13D5C24F00AE47D1 /* UIColor+Extensions.m */,
7FAEB66F13E6D3AB00750788 /* UIImage+Tinting.h */,
7FAEB67013E6D3AB00750788 /* UIImage+Tinting.m */,
4509175823D030130028AF83 /* DarkModeCheck.h */,
4509175923D030130028AF83 /* DarkModeCheck.m */,
DA4984451C12C85F009BFC8F /* UIViewController+Orientation.h */,
DA4984461C12C85F009BFC8F /* UIViewController+Orientation.m */,
);
Expand Down Expand Up @@ -877,7 +865,6 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand All @@ -896,25 +883,21 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7F0BF5D413D3154F0063A6B0 /* TopBackground.png in Resources */,
7F0BF5DA13D3317D0063A6B0 /* ShadowTop.png in Resources */,
4509175523CFBD1A0028AF83 /* ReviewTemplate_dark.html in Resources */,
7F0BF5DB13D3317D0063A6B0 /* ShadowBottom.png in Resources */,
7FDF6E8113D8962500B8CC4E /* countries.plist in Resources */,
DAD39BA71EEC9B3100CB3524 /* [email protected] in Resources */,
7FDF6E8313D89B1000B8CC4E /* countries_simple.plist in Resources */,
DA9DB1B91C101FB2007B0178 /* LaunchScreen.storyboard in Resources */,
DA2995CD1C120E4C0009D4F1 /* Icon216.png in Resources */,
4509175323CF7E990028AF83 /* About_dark.html in Resources */,
62E09F1B19E693F3002917FE /* Images.xcassets in Resources */,
7FAB533413DD0F9A0027274F /* country_names.plist in Resources */,
DAD39BA51EEC9B2D00CB3524 /* [email protected] in Resources */,
45C2B2222460296200C84374 /* csv_dark.css in Resources */,
DA2231A71DB318CC009071A3 /* SAMKeychain.bundle in Resources */,
DA7B08E11C154CFB00BEAB57 /* FlagKit.xcassets in Resources */,
7F89BCE313DFB4F1001C607F /* stores.plist in Resources */,
7F26DF9413E1358B001D0F33 /* ReviewTemplate.html in Resources */,
45C2B2232460296200C84374 /* csv.css in Resources */,
45C2B2232460296200C84374 /* csv.css in Resources */,
7FAEB68F13E75B0000750788 /* About.html in Resources */,
6D81576514CB44BE005E8F3F /* passcode_square_empty.png in Resources */,
6D81576614CB44BE005E8F3F /* [email protected] in Resources */,
Expand Down Expand Up @@ -948,7 +931,7 @@
7F1499E113BE544F00D89064 /* ReportDownloadCoordinator.m in Sources */,
DA4AC6A31EF9CBB4003CAF4D /* ReviewFilter.m in Sources */,
7F06B6BF13BF73C8004DB170 /* Report.m in Sources */,
4509175A23D030130028AF83 /* DarkModeCheck.m in Sources */,
4509175A23D030130028AF83 /* DarkModeCheck.m in Sources */,
7F1B14F313C51ACA00243AA3 /* CurrencyManager.m in Sources */,
7F1B153713C8029700243AA3 /* ReportImportOperation.m in Sources */,
7F6BC9AB13CB64DB00286A1E /* GraphView.m in Sources */,
Expand Down
1 change: 1 addition & 0 deletions Classes/AboutViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@interface AboutViewController : UIViewController <UIWebViewDelegate> {
UIWebView *webView;
BOOL didCheckForUpdates;
}

+ (NSString *)appVersion;
Expand Down
31 changes: 20 additions & 11 deletions Classes/AboutViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

#import "AboutViewController.h"
#import "DarkModeCheck.h"

NSString *const kAppGitHubRepoInfoPLIST = @"https://gitcdn.xyz/repo/nicolasgomollon/AppSales-Mobile/master/Support/AppSales-Info.plist";

Expand All @@ -30,25 +29,30 @@ + (NSString *)latestBuild {
}

+ (NSString *)aboutHTML {
NSString *htmlName = [DarkModeCheck checkForDarkModeHtml:@"About"];
NSString *webpagePath = [[NSBundle mainBundle] pathForResource:htmlName ofType:@"html"];
NSString *webpagePath = [[NSBundle mainBundle] pathForResource:@"About" ofType:@"html"];
NSString *fileHTML = [[NSString alloc] initWithContentsOfFile:webpagePath encoding:NSUTF8StringEncoding error:nil];
fileHTML = [fileHTML stringByReplacingOccurrencesOfString:@"[[APP_VERSION_BUILD]]" withString:AboutViewController.appVersion];
return fileHTML;
}

- (void)loadView {
[super loadView];

self.title = NSLocalizedString(@"About", nil);

webView = [[UIWebView alloc] initWithFrame:CGRectZero];

if (@available(iOS 13.0, *)) {
webView.backgroundColor = [UIColor systemBackgroundColor];
} else {
// Fallback on earlier versions
webView.backgroundColor = [UIColor colorWithRed:197.0f/255.0f green:204.0f/255.0f blue:212.0f/255.0f alpha:1.0f];
}

if (@available(iOS 13.0, *)) {
webView.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {
switch (traitCollection.userInterfaceStyle) {
case UIUserInterfaceStyleDark:
return [UIColor systemBackgroundColor];
default:
return [UIColor colorWithRed:197.0f/255.0f green:204.0f/255.0f blue:212.0f/255.0f alpha:1.0f];
}
}];
} else {
webView.backgroundColor = [UIColor colorWithRed:197.0f/255.0f green:204.0f/255.0f blue:212.0f/255.0f alpha:1.0f];
}
webView.opaque = NO;
webView.scalesPageToFit = YES;
webView.dataDetectorTypes = UIDataDetectorTypeNone;
Expand All @@ -59,6 +63,11 @@ - (void)loadView {
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];

if (didCheckForUpdates) { return; }
didCheckForUpdates = YES;

NSString *aboutHTML = AboutViewController.aboutHTML;
aboutHTML = [aboutHTML stringByReplacingOccurrencesOfString:@"[[APP_VERSION_STATUS_COLOR]]" withString:@""];
aboutHTML = [aboutHTML stringByReplacingOccurrencesOfString:@"[[APP_VERSION_STATUS_TEXT]]" withString:@"CHECKING FOR UPDATES..."];
Expand Down
19 changes: 17 additions & 2 deletions Classes/AccountStatusView.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,30 @@ - (instancetype)initWithFrame:(CGRect)frame account:(ASAccount *)anAccount {
account = anAccount;
self.backgroundColor = [UIColor clearColor];
activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(20, 5, 16, 16)];
activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
if (@available(iOS 13.0, *)) {
activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleMedium;
} else {
activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
}
activityIndicator.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
[self addSubview:activityIndicator];

statusLabel = [[UILabel alloc] initWithFrame:CGRectMake(36, 5, frame.size.width - 2 * 36, 16)];
statusLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
statusLabel.backgroundColor = [UIColor clearColor];
statusLabel.font = [UIFont systemFontOfSize:14.0];
statusLabel.textColor = [UIColor colorWithRed:0.322 green:0.357 blue:0.443 alpha:1.0];
if (@available(iOS 13.0, *)) {
statusLabel.textColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {
switch (traitCollection.userInterfaceStyle) {
case UIUserInterfaceStyleDark:
return [UIColor colorWithRed:142.0f/255.0f green:142.0f/255.0f blue:147.0f/255.0f alpha:1.0f];
default:
return [UIColor colorWithRed:109.0f/255.0f green:109.0f/255.0f blue:114.0f/255.0f alpha:1.0f];
}
}];
} else {
statusLabel.textColor = [UIColor colorWithRed:109.0f/255.0f green:109.0f/255.0f blue:114.0f/255.0f alpha:1.0f];
}
statusLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:statusLabel];

Expand Down
2 changes: 0 additions & 2 deletions Classes/AccountsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ - (void)showInfo:(id)sender {
UINavigationController *aboutNavController = [[UINavigationController alloc] initWithRootViewController:aboutViewController];
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
aboutNavController.modalPresentationStyle = UIModalPresentationFormSheet;
} else {
aboutNavController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
}
[self presentViewController:aboutNavController animated:YES completion:nil];
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/AppSalesAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ - (void)showPasscodeLockIfNeededWithBiometrics:(BOOL)useBiometrics {
passcodeVC.delegate = self;

UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:passcodeVC];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
nav.modalPresentationStyle = UIModalPresentationFullScreen;
nav.navigationBar.barStyle = UIBarStyleBlack;
nav.navigationBar.opaque = NO;
} else {
Expand Down
39 changes: 30 additions & 9 deletions Classes/BadgedCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#import "AppIconView.h"
#import "Product.h"
#import "UIImage+Tinting.h"
#import "DarkModeCheck.h"

CGFloat const kBadgePadding = 6.0f;

Expand All @@ -21,6 +22,10 @@ @implementation BadgedCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
if (@available(iOS 13.0, *)) {
self.backgroundColor = [UIColor secondarySystemGroupedBackgroundColor];
}

self.textLabel.backgroundColor = [UIColor clearColor];
self.textLabel.translatesAutoresizingMaskIntoConstraints = NO;

Expand Down Expand Up @@ -48,7 +53,7 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr
[self.contentView addConstraint:textLabelLeftMarginConstraint];

badgeView = [[UIImageView alloc] init];
badgeView.image = [[UIImage imageNamed:@"Badge"] resizableImageWithCapInsets:UIEdgeInsetsMake(9.0f, 9.0f, 9.0f, 9.0f) resizingMode:UIImageResizingModeTile];
[self updateBadgeImage];
badgeView.highlightedImage = [[UIImage as_tintedImageNamed:@"Badge" color:[UIColor whiteColor]] resizableImageWithCapInsets:UIEdgeInsetsMake(9.0f, 9.0f, 9.0f, 9.0f) resizingMode:UIImageResizingModeTile];
badgeView.translatesAutoresizingMaskIntoConstraints = NO;
badgeView.hidden = YES;
Expand Down Expand Up @@ -84,7 +89,7 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr
toItem:self.contentView
attribute:NSLayoutAttributeRight
multiplier:1.0f
constant:0.0f];
constant:-8.0f];

badgeViewRightMarginConstraint = [NSLayoutConstraint constraintWithItem:badgeView
attribute:NSLayoutAttributeRight
Expand Down Expand Up @@ -134,6 +139,12 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr
return self;
}

- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
[super traitCollectionDidChange:previousTraitCollection];
self.imageName = imageName;
[self updateBadgeImage];
}

- (void)setAccessoryType:(UITableViewCellAccessoryType)accessoryType {
[super setAccessoryType:accessoryType];
[self.contentView removeConstraints:@[badgeViewRightConstraint, badgeViewRightMarginConstraint]];
Expand All @@ -156,18 +167,28 @@ - (void)setProduct:(Product *)_product {

- (void)setImageName:(NSString *)_imageName {
imageName = _imageName;

if (@available(iOS 13.0, *)) {
self.imageView.image = (imageName != nil) ? [UIImage as_tintedImageNamed:imageName color:[[UIColor labelColor] colorWithAlphaComponent:0.4]] : nil;
} else {
self.imageView.image = (imageName != nil) ? [UIImage imageNamed:imageName] : nil;
}

if (imageName != nil) {
if ([DarkModeCheck deviceIsInDarkMode]) {
self.imageView.image = [UIImage as_tintedImageNamed:imageName color:[UIColor colorWithWhite:1.0 alpha:0.4]];
} else {
self.imageView.image = [UIImage imageNamed:imageName];
}
} else {
self.imageView.image = nil;
}
self.imageView.highlightedImage = (imageName != nil) ? [UIImage as_tintedImageNamed:imageName color:[UIColor whiteColor]] : nil;
[self.contentView removeConstraints:@[textLabelLeftConstraint, textLabelLeftMarginConstraint]];
[self.contentView addConstraint:(imageName == nil) ? textLabelLeftMarginConstraint : textLabelLeftConstraint];
}

- (void)updateBadgeImage {
if ([DarkModeCheck deviceIsInDarkMode]) {
badgeView.image = [[UIImage as_tintedImageNamed:@"Badge" color:[UIColor colorWithWhite:0.0 alpha:0.5]] resizableImageWithCapInsets:UIEdgeInsetsMake(9.0f, 9.0f, 9.0f, 9.0f) resizingMode:UIImageResizingModeTile];
} else {
badgeView.image = [[UIImage imageNamed:@"Badge"] resizableImageWithCapInsets:UIEdgeInsetsMake(9.0f, 9.0f, 9.0f, 9.0f) resizingMode:UIImageResizingModeTile];
}
}

- (void)setBadgeCount:(NSInteger)_badgeCount {
badgeCount = _badgeCount;
if (badgeCount == 0) {
Expand Down
3 changes: 1 addition & 2 deletions Classes/DarkModeCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ NS_ASSUME_NONNULL_BEGIN

@interface DarkModeCheck : NSObject

+(BOOL)deviceIsInDarkMode;
+ (BOOL)deviceIsInDarkMode;
+ (UIImage *)checkForDarkModeImage:(NSString *)name;
+ (NSString *)checkForDarkModeHtml:(NSString *)htmlName;

@end

Expand Down
Loading

0 comments on commit b1694a3

Please sign in to comment.