i have a program in which i get a tweets from twitter and show them in UITableviewcell
. now problem is that i have to make a all twitter names bold and bule and show them in the orginal tweet with bule and bold names.
For Example i have tweet like this
MT @OraTV
: SNEAK PEEK: @tomgreenlive @TheoVon & @DavidBegnaud
talk Miley's #twerking #Batfleck &more
on
so all the names starting with @ should be bold and bule.
i use this code to extract All names starting with @ but not know how to bold them and show them in single uitableviewcell
NSString * aString =twitterMessage
NSMutableArray *substrings = [NSMutableArray new];
NSScanner *scanner = [NSScanner scannerWithString:aString];
[scanner scanUpToString:@"@" intoString:nil];
while(![scanner isAtEnd]) {
NSString *substring = nil;
[scanner scanString:@"@" intoString:nil];
if([scanner scanUpToString:@" " intoString:&substring]) {
[substrings addObject:substring];
}
[scanner scanUpToString:@"@" intoString:nil];
}