Skip to content
Open
Prev Previous commit
Next Next commit
Remove incorrect _Nullable and add const to options arguments
  • Loading branch information
hsource committed Apr 12, 2022
commit a8a2ff443540028f3ec1a14813c097f060714205
12 changes: 6 additions & 6 deletions ios/RNTextSize.m
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ - (NSString *)fontStyleFromTraits:(const NSDictionary *)traits
return count ? [NSArray arrayWithObjects:outArr count:count] : nil;
}

- (CGSize)maxSizeFromOptions:(NSDictionary * _Nullable)options
- (CGSize)maxSizeFromOptions:(const NSDictionary *)options
{
const CGFloat optWidth = CGFloatValueFrom(options[@"width"]);
const CGFloat maxWidth = isnan(optWidth) || isinf(optWidth) ? CGFLOAT_MAX : optWidth;
Expand All @@ -584,7 +584,7 @@ - (CGSize)maxSizeFromOptions:(NSDictionary * _Nullable)options
/**
* Creates a textContainer with the width and numberOfLines from options.
*/
- (NSTextContainer *)textContainerFromOptions:(NSDictionary * _Nullable)options
- (NSTextContainer *)textContainerFromOptions:(const NSDictionary *)options
withMaxSize:(CGSize)maxSize
{
NSTextContainer *textContainer = [[NSTextContainer alloc] initWithSize:maxSize];
Expand All @@ -603,7 +603,7 @@ - (NSTextContainer *)textContainerFromOptions:(NSDictionary * _Nullable)options
* Creates attributes that should be passed into the TextStorage based on
* parameters and the options the user passes in.
*/
- (NSDictionary<NSAttributedStringKey,id> *const)textStorageAttributesFromOptions:(NSDictionary * _Nullable)options
- (NSDictionary<NSAttributedStringKey,id> *const)textStorageAttributesFromOptions:(const NSDictionary *)options
withFont:(UIFont *const _Nullable)font
withLetterSpacing:(CGFloat)letterSpacing
{
Expand Down Expand Up @@ -634,9 +634,9 @@ - (CGFloat)fontScaleMultiplier {
* React Native ceils sizes to the nearest pixels by default, so we usually
* want to adjust it to that
*/
- (CGFloat)adjustMeasuredSize:(const CGFloat)size
withOptions:(NSDictionary *)options
withMaxSize:(const CGFloat)maxSize
- (CGFloat)adjustMeasuredSize:(CGFloat)size
withOptions:(const NSDictionary *)options
withMaxSize:(CGFloat)maxSize
{
CGFloat adjusted = size;

Expand Down