Skip to content

Commit

Permalink
Remove RCTGetMultiplierForContentSizeCategory (#39617)
Browse files Browse the repository at this point in the history
Summary:
It seems this method is not referenced by anything anymore. I think #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: #39617

Test Plan: CI should pass

Reviewed By: dmytrorykun

Differential Revision: D49618166

Pulled By: cipolleschi

fbshipit-source-id: fb72e961d2a1eb9977944fea3ee4deeab46b946b
  • Loading branch information
Saadnajmi authored and facebook-github-bot committed Oct 9, 2023
1 parent 12eef6e commit 6a2c245
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
4 changes: 0 additions & 4 deletions packages/react-native/React/UIUtils/RCTUIUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 0 additions & 25 deletions packages/react-native/React/UIUtils/RCTUIUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,3 @@ RCTDimensions RCTGetDimensions(CGFloat fontScale)

return result;
}

CGFloat RCTGetMultiplierForContentSizeCategory(UIContentSizeCategory category)
{
static NSDictionary<NSString *, NSNumber *> *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;
}

0 comments on commit 6a2c245

Please sign in to comment.