Skip to content

Commit

Permalink
Replace currentAppearance with currentDrawingAppearance on macOS 11+ (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Saadnajmi authored Feb 18, 2022
1 parent 75775ca commit 88de79a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion React/CoreModules/RCTAppearance.mm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ void RCTOverrideAppearancePreference(NSString *const colorSchemeOverride)
return RCTAppearanceColorSchemeLight;
}

appearance = appearance ?: [NSAppearance currentAppearance];
if (@available(macOS 11.0, *)) {
appearance = appearance ?: [NSAppearance currentDrawingAppearance];
} else {
appearance = appearance ?: [NSAppearance currentAppearance];
}
NSAppearanceName appearanceName = [appearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
return appearances[appearanceName] ?: RCTAppearanceColorSchemeLight;
}
Expand Down

0 comments on commit 88de79a

Please sign in to comment.