From 08574251153406e4755f58c2ee5548ee32e308fb Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 3 Nov 2013 06:08:35 +0400 Subject: avatars --- Juick/MasterViewController.m | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Juick/MasterViewController.m') diff --git a/Juick/MasterViewController.m b/Juick/MasterViewController.m index 26035cd..4ed8df1 100644 --- a/Juick/MasterViewController.m +++ b/Juick/MasterViewController.m @@ -127,6 +127,7 @@ static NSString *CellIdentifier = @"MessageCell"; MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; [cell updateFonts]; Message *msg = [_messages objectAtIndex:indexPath.row]; + [cell.avatar setImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://i.juick.com/as/%@.png", msg.userID]]]]]; cell.titleLabel.text = msg.user; cell.bodyLabel.text = msg.text; [cell setNeedsUpdateConstraints]; @@ -136,11 +137,13 @@ static NSString *CellIdentifier = @"MessageCell"; - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; [cell updateFonts]; Message *msg = [_messages objectAtIndex:indexPath.row]; + [cell.avatar setImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://i.juick.com/as/%@.png", msg.userID]]]]]; cell.titleLabel.text = msg.user; cell.bodyLabel.text = msg.text; -- cgit v1.2.3