From 6a2c245241f47700d3bdb76d2a4dace503ac689c Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Mon, 9 Oct 2023 08:37:41 -0700 Subject: [PATCH] Remove RCTGetMultiplierForContentSizeCategory (#39617) Summary: It seems this method is not referenced by anything anymore. I think https://github.com/facebook/react-native/pull/35017 made it redundant. Let's remove it? I can also do the whole "Deprecate for one version, remove in the next" since this was publicly exported. ## Changelog: [iOS] [REMOVED] - Remove RCTGetMultiplierForContentSizeCategory Pull Request resolved: https://github.com/facebook/react-native/pull/39617 Test Plan: CI should pass Reviewed By: dmytrorykun Differential Revision: D49618166 Pulled By: cipolleschi fbshipit-source-id: fb72e961d2a1eb9977944fea3ee4deeab46b946b --- .../react-native/React/UIUtils/RCTUIUtils.h | 4 --- .../react-native/React/UIUtils/RCTUIUtils.m | 25 ------------------- 2 files changed, 29 deletions(-) diff --git a/packages/react-native/React/UIUtils/RCTUIUtils.h b/packages/react-native/React/UIUtils/RCTUIUtils.h index addf12e406a3f7..78d647af9a9aec 100644 --- a/packages/react-native/React/UIUtils/RCTUIUtils.h +++ b/packages/react-native/React/UIUtils/RCTUIUtils.h @@ -23,10 +23,6 @@ typedef struct { } RCTDimensions; extern __attribute__((visibility("default"))) RCTDimensions RCTGetDimensions(CGFloat fontScale); -// Get font size multiplier for font base size (Large) by content size category -extern __attribute__((visibility("default"))) CGFloat RCTGetMultiplierForContentSizeCategory( - UIContentSizeCategory category) __deprecated; - #ifdef __cplusplus } #endif diff --git a/packages/react-native/React/UIUtils/RCTUIUtils.m b/packages/react-native/React/UIUtils/RCTUIUtils.m index 9dce915ae94b58..ed2aa676e27a9d 100644 --- a/packages/react-native/React/UIUtils/RCTUIUtils.m +++ b/packages/react-native/React/UIUtils/RCTUIUtils.m @@ -29,28 +29,3 @@ RCTDimensions RCTGetDimensions(CGFloat fontScale) return result; } - -CGFloat RCTGetMultiplierForContentSizeCategory(UIContentSizeCategory category) -{ - static NSDictionary *multipliers = nil; - static dispatch_once_t token; - dispatch_once(&token, ^{ - multipliers = @{ - UIContentSizeCategoryExtraSmall : @0.823, - UIContentSizeCategorySmall : @0.882, - UIContentSizeCategoryMedium : @0.941, - UIContentSizeCategoryLarge : @1.0, - UIContentSizeCategoryExtraLarge : @1.118, - UIContentSizeCategoryExtraExtraLarge : @1.235, - UIContentSizeCategoryExtraExtraExtraLarge : @1.353, - UIContentSizeCategoryAccessibilityMedium : @1.786, - UIContentSizeCategoryAccessibilityLarge : @2.143, - UIContentSizeCategoryAccessibilityExtraLarge : @2.643, - UIContentSizeCategoryAccessibilityExtraExtraLarge : @3.143, - UIContentSizeCategoryAccessibilityExtraExtraExtraLarge : @3.571 - }; - }); - - double value = multipliers[category].doubleValue; - return value > 0.0 ? value : 1.0; -}