Skip to content

Commit 88de79a

Browse files
authored
Replace currentAppearance with currentDrawingAppearance on macOS 11+ (#1029)
1 parent 75775ca commit 88de79a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

React/CoreModules/RCTAppearance.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ void RCTOverrideAppearancePreference(NSString *const colorSchemeOverride)
8181
return RCTAppearanceColorSchemeLight;
8282
}
8383

84-
appearance = appearance ?: [NSAppearance currentAppearance];
84+
if (@available(macOS 11.0, *)) {
85+
appearance = appearance ?: [NSAppearance currentDrawingAppearance];
86+
} else {
87+
appearance = appearance ?: [NSAppearance currentAppearance];
88+
}
8589
NSAppearanceName appearanceName = [appearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
8690
return appearances[appearanceName] ?: RCTAppearanceColorSchemeLight;
8791
}

0 commit comments

Comments
 (0)