You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using TTTAttributedLabel for display user tag on table view cell. I have issue when user tap on link one of cell tag user its automatic changes the all cell link string text color to text color.
In simulator working fine but on device getting this effect
Help me, if I am missing something.
I am using TTTAttributedLabel for display user tag on table view cell. I have issue when user tap on link one of cell tag user its automatic changes the all cell link string text color to text color.
In simulator working fine but on device getting this effect
Help me, if I am missing something.
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"tttDemo";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
cell.accessoryType = UITableViewCellAccessoryNone;
}
NSString *str= @"@dj hello @Dhanraj @pradeep nice @test @well @team yes @good";
TTTAttributedLabel *summaryLabel =(TTTAttributedLabel *)[cell viewWithTag:55];
summaryLabel.font = [UIFont systemFontOfSize:14];
summaryLabel.textColor = [UIColor blackColor];
summaryLabel.lineBreakMode = NSLineBreakByWordWrapping;
summaryLabel.numberOfLines = 0;
summaryLabel.linkAttributes =[NSDictionary dictionaryWithObjectsAndKeys:
summaryLabel.userInteractionEnabled = YES;
summaryLabel.delegate=self;
summaryLabel.text=str;
self.isAccessibilityElement = NO;
//For clickable @tagged UserName
NSRegularExpression *regexp=UserNameRegularExpression();
[regexp enumerateMatchesInString:summaryLabel.text options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, __unused NSMatchingFlags flags, __unused BOOL *stop) {
}
];
summaryLabel.activeLinkAttributes=nil;
return cell;
}
The text was updated successfully, but these errors were encountered: