mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Compile out UIFontTextStyleLargeTitle
Summary: UIFontTextStyleLargeTitle is unavailable on AppleTV https://developer.apple.com/documentation/uikit/uifont/textstyle/largetitle?changes=_4 Changelog: [Internal] Reviewed By: javache Differential Revision: D90514242 fbshipit-source-id: 3fafbe513b52d5e733df336c401f2e76268496ea
This commit is contained in:
1 parent
400a3b5916
commit
f15985f4f0
2 files changed
+11
-3
No files matched your search
@@ -34,7 +34,7 @@ UIFontMetrics *RCTUIFontMetricsForDynamicTypeRamp(RCTDynamicTypeRamp dynamicType
|
||||
static NSDictionary<NSNumber *, UIFontTextStyle> *mapping;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
mapping = @{
|
||||
NSMutableDictionary<NSNumber *, UIFontTextStyle> *mutableMapping = [@{
|
||||
@(RCTDynamicTypeRampCaption2) : UIFontTextStyleCaption2,
|
||||
@(RCTDynamicTypeRampCaption1) : UIFontTextStyleCaption1,
|
||||
@(RCTDynamicTypeRampFootnote) : UIFontTextStyleFootnote,
|
||||
@@ -45,8 +45,11 @@ UIFontMetrics *RCTUIFontMetricsForDynamicTypeRamp(RCTDynamicTypeRamp dynamicType
|
||||
@(RCTDynamicTypeRampTitle3) : UIFontTextStyleTitle3,
|
||||
@(RCTDynamicTypeRampTitle2) : UIFontTextStyleTitle2,
|
||||
@(RCTDynamicTypeRampTitle1) : UIFontTextStyleTitle1,
|
||||
@(RCTDynamicTypeRampLargeTitle) : UIFontTextStyleLargeTitle,
|
||||
};
|
||||
} mutableCopy];
|
||||
#if !TARGET_OS_TV
|
||||
mutableMapping[@(RCTDynamicTypeRampLargeTitle)] = UIFontTextStyleLargeTitle;
|
||||
#endif
|
||||
mapping = [mutableMapping copy];
|
||||
});
|
||||
|
||||
id textStyle =
|
||||
|
||||
+5
@@ -60,7 +60,12 @@ inline static UIFontTextStyle RCTUIFontTextStyleForDynamicTypeRamp(const Dynamic
|
||||
case DynamicTypeRamp::Title1:
|
||||
return UIFontTextStyleTitle1;
|
||||
case DynamicTypeRamp::LargeTitle:
|
||||
// UIFontTextStyleLargeTitle is not available on tvOS.
|
||||
#if !TARGET_OS_TV
|
||||
return UIFontTextStyleLargeTitle;
|
||||
#else
|
||||
return UIFontTextStyleTitle1;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user