// // ConversationCell.m // Juick // // Created by Vitaly Takmazov on 04/03/2018. // Copyright © 2018 com.juick. All rights reserved. // #import "ConversationCell.h" @implementation ConversationCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } -(void) configureWithChat:(Chat *)chat { self.chatName.text = chat.uname; self.lastMessage.text = @""; self.unreadMarker.text = @""; __weak UIImageView *weakAvatar; [self.avatar setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [chat.uid intValue]]]] placeholderImage:nil success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull image) { [UIView transitionWithView:weakAvatar duration:0.3 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{ weakAvatar.image = image; } completion:nil]; } failure:nil]; } @end