Skip to content

Commit a84033b

Browse files
author
Morgan Pretty
committed
Added missing getters to fix an EXC_BAD_ACCESS crash in RN 0.23.0.
1 parent fefdf2f commit a84033b

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

Diff for: ios/RNSpinkit.m

+16-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ - (void)setSize:(NSNumber*)size {
2020
}
2121
}
2222

23+
- (NSNumber*)size {
24+
return _size;
25+
}
26+
2327
- (void)setType:(NSString*)type
2428
{
2529
_type = type;
@@ -29,6 +33,10 @@ - (void)setType:(NSString*)type
2933
}
3034
}
3135

36+
- (NSString*)type {
37+
return _type;
38+
}
39+
3240
- (void)setColor:(NSString*)color
3341
{
3442
_color = color;
@@ -38,12 +46,16 @@ - (void)setColor:(NSString*)color
3846
}
3947
}
4048

49+
- (NSString*)color {
50+
return _color;
51+
}
52+
4153
#pragma mark - Utility
4254

4355
- (RTSpinKitViewStyle)getStyleFromString:(NSString*)type
4456
{
4557
RTSpinKitViewStyle style = RTSpinKitViewStylePlane;
46-
58+
4759
if ([type isEqual:@"CircleFlip"])
4860
style = RTSpinKitViewStyleCircleFlip;
4961
else if ([type isEqual:@"Bounce"])
@@ -81,11 +93,11 @@ - (UIColor*)getColorFromString:(NSString*)color
8193
NSScanner *scanner = [NSScanner scannerWithString:color];
8294
[scanner setScanLocation:1]; // bypass '#' character
8395
[scanner scanHexInt:&rgbValue];
84-
96+
8597
if (color.length == @"#00000000".length) {
8698
return [UIColor colorWithRed:((rgbValue & 0xFF000000) >> 24)/255.0 green:((rgbValue & 0xFF0000) >> 16)/255.0 blue:((rgbValue & 0xFF00) >> 8)/255.0 alpha:(rgbValue & 0xFF)/255.0];
8799
}
88-
100+
89101
return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:1.0];
90102
}
91103

@@ -117,4 +129,4 @@ - (void)removeFromSuperview
117129
[super removeFromSuperview];
118130
}
119131

120-
@end
132+
@end

0 commit comments

Comments
 (0)