File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,15 +51,15 @@ - (void)setImageWithString:(NSString *)string color:(UIColor *)color {
5151 NSArray *words = [string componentsSeparatedByCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet ]];
5252
5353 if ([words count ]) {
54- NSString *firstWord = words[ 0 ];
54+ NSString *firstWord = [words firstObject ];
5555 if ([firstWord length ]) {
56- [displayString appendString: [firstWord substringWithRange: NSMakeRange ( 0 , 1 ) ]];
56+ [displayString appendString: [firstWord substringToIndex: 1 ]];
5757 }
5858
5959 if ([words count ] >= 2 ) {
60- NSString *lastWord = words[[ words count ] - 1 ];
60+ NSString *lastWord = [ words lastObject ];
6161 if ([lastWord length ]) {
62- [displayString appendString: [lastWord substringWithRange: NSMakeRange ( 0 , 1 ) ]];
62+ [displayString appendString: [lastWord substringToIndex: 1 ]];
6363 }
6464 }
6565 }
You can’t perform that action at this time.
0 commit comments