diff options
Diffstat (limited to 'Juick/Views/ConversationCell.m')
-rw-r--r-- | Juick/Views/ConversationCell.m | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Juick/Views/ConversationCell.m b/Juick/Views/ConversationCell.m index e4a000c..dd17963 100644 --- a/Juick/Views/ConversationCell.m +++ b/Juick/Views/ConversationCell.m @@ -7,6 +7,7 @@ // #import "ConversationCell.h" +#import "APIClient.h" @implementation ConversationCell @@ -16,15 +17,15 @@ self.lastMessage.text = chat.lastMessageText; self.unreadMarker.hidden = true; __weak UIImageView *weakAvatar = self.avatar; - [self.avatar setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:chat.avatar]] placeholderImage:nil success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull image) { + [[APIClient sharedClient] fetchImageWithURL:[NSURL URLWithString:chat.avatar] callback:^(NSData *data) { [UIView transitionWithView:weakAvatar duration:0.3 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{ - weakAvatar.image = image; + weakAvatar.image = [UIImage imageWithData:data]; } completion:nil]; - } failure:nil]; + }]; } @end |