Skip to content

Commit

Permalink
Replace currentAppearance with currentDrawingAppearance on macOS 11+ (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
Saadnajmi committed Feb 18, 2022
1 parent 59839fa commit cc3880c
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 cc3880c

Please sign in to comment.