[iOS] Fixes for native animation of width and height of Rect

Allow string or float values.
This commit is contained in:
Mikael Sand
2018-10-10 22:53:58 +03:00
parent e307eeee57
commit 7c012a9fe3
+20 -2
View File
@@ -22,8 +22,26 @@ RCT_EXPORT_MODULE()
RCT_EXPORT_VIEW_PROPERTY(x, NSString)
RCT_EXPORT_VIEW_PROPERTY(y, NSString)
RCT_EXPORT_VIEW_PROPERTY(rectwidth, NSString)
RCT_EXPORT_VIEW_PROPERTY(rectheight, NSString)
RCT_CUSTOM_VIEW_PROPERTY(rectheight, id, RNSVGRect)
{
if ([json isKindOfClass:[NSString class]]) {
NSString *stringValue = (NSString *)json;
view.rectheight = stringValue;
} else {
view.rectheight = [NSString stringWithFormat:@"%f", [json floatValue]];
}
}
RCT_CUSTOM_VIEW_PROPERTY(rectwidth, id, RNSVGRect)
{
if ([json isKindOfClass:[NSString class]]) {
NSString *stringValue = (NSString *)json;
view.rectwidth = stringValue;
} else {
view.rectwidth = [NSString stringWithFormat:@"%f", [json floatValue]];
}
}
RCT_EXPORT_VIEW_PROPERTY(rx, NSString)
RCT_EXPORT_VIEW_PROPERTY(ry, NSString)