Skip to content

Commit 8dabb58

Browse files
committed
Add availability check for appearanceWhenContainedInInstancesOfClasses
1 parent e1d77be commit 8dabb58

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Apptentive/Apptentive/Apptentive.m

+8-3
Original file line numberDiff line numberDiff line change
@@ -933,9 +933,14 @@ @implementation ApptentiveNavigationController
933933
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
934934
self = [super initWithCoder:aDecoder];
935935
if (self) {
936-
937-
if (!([UINavigationBar appearance].barTintColor || [UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[ [ApptentiveNavigationController class] ]].barTintColor)) {
938-
[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[ [ApptentiveNavigationController class] ]].barTintColor = [UIColor whiteColor];
936+
if (@available(iOS 9.0, *)) {
937+
if (!([UINavigationBar appearance].barTintColor || [UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[ [ApptentiveNavigationController class] ]].barTintColor)) {
938+
[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[ [ApptentiveNavigationController class] ]].barTintColor = [UIColor whiteColor];
939+
}
940+
} else {
941+
if (!([UINavigationBar appearance].barTintColor || [UINavigationBar appearanceWhenContainedIn:[ApptentiveNavigationController class], nil].barTintColor)) {
942+
[UINavigationBar appearanceWhenContainedIn:[ApptentiveNavigationController class], nil].barTintColor = [UIColor whiteColor];
943+
}
939944
}
940945
}
941946
return self;

0 commit comments

Comments
 (0)