diff --git a/React/Base/RCTConvert.h b/React/Base/RCTConvert.h index cad32b860..d03140e08 100644 --- a/React/Base/RCTConvert.h +++ b/React/Base/RCTConvert.h @@ -56,6 +56,7 @@ typedef NSURL RCTFileURL; + (NSTimeZone *)NSTimeZone:(id)json; + (NSTimeInterval)NSTimeInterval:(id)json; ++ (NSLineBreakMode)NSLineBreakMode:(id)json; + (NSTextAlignment)NSTextAlignment:(id)json; + (NSUnderlineStyle)NSUnderlineStyle:(id)json; + (NSWritingDirection)NSWritingDirection:(id)json; diff --git a/React/Base/RCTConvert.m b/React/Base/RCTConvert.m index 88e7e3f51..822108d31 100644 --- a/React/Base/RCTConvert.m +++ b/React/Base/RCTConvert.m @@ -205,6 +205,15 @@ NSNumber *RCTConvertMultiEnumValue(const char *typeName, NSDictionary *mapping, return RCTConvertEnumValue(typeName, mapping, defaultValue, json); } +RCT_ENUM_CONVERTER(NSLineBreakMode, (@{ + @"wordWrapping": @(NSLineBreakByWordWrapping), + @"charWrapping": @(NSLineBreakByCharWrapping), + @"clipping": @(NSLineBreakByClipping), + @"truncatingHead": @(NSLineBreakByTruncatingHead), + @"truncatingTail": @(NSLineBreakByTruncatingTail), + @"truncatingMiddle": @(NSLineBreakByTruncatingMiddle), +}), NSLineBreakByWordWrapping, integerValue) + RCT_ENUM_CONVERTER(NSTextAlignment, (@{ @"auto": @(NSTextAlignmentNatural), @"left": @(NSTextAlignmentLeft),