Skip to content

Commit 12dbb86

Browse files
committed
Add new iOS 10 methods for bar and control tinit color
1 parent 22c0c55 commit 12dbb86

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/ios/SafariViewController.m

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,18 @@ - (void) show:(CDVInvokedUrlCommand*)command {
5252

5353
NSString *tintColor = options[@"tintColor"];
5454
if (tintColor != nil) {
55-
vc.view.tintColor = [self colorFromHexString:options[@"tintColor"]];
55+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000 // iOS 10.0 supported
56+
vc.preferredControlTintColor = [self colorFromHexString:options[@"tintColor"]];
57+
#else
58+
vc.view.tintColor = [self colorFromHexString:options[@"tintColor"]];
59+
#endif
60+
}
61+
62+
NSString *barColor = options[@"barColor"];
63+
if (barColor != nil) {
64+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000 // iOS 10.0 supported
65+
vc.preferredBarTintColor = [self colorFromHexString:options[@"barColor"]];
66+
#endif
5667
}
5768

5869
CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:@{@"event":@"opened"}];

0 commit comments

Comments
 (0)