diff options
author | Vitaly Takmazov | 2019-03-21 01:23:22 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-03-21 14:08:52 +0300 |
commit | 1871f3d5298efb978be825b03fd9c20ff4c204a8 (patch) | |
tree | 61e4683669ce240b28b066f5cc30556fcaeff85c /Juick/Views | |
parent | 458e55b9cddcadb2bbbe3fb4002f06a5744b84c0 (diff) |
APIClient fetchImageWithURL
Diffstat (limited to 'Juick/Views')
-rw-r--r-- | Juick/Views/MessageCell.m | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Juick/Views/MessageCell.m b/Juick/Views/MessageCell.m index fb6e831..55e6054 100644 --- a/Juick/Views/MessageCell.m +++ b/Juick/Views/MessageCell.m @@ -32,15 +32,15 @@ self.message = msg; self.avatar.image = nil; __weak UIImageView *weakAvatar = self.avatar; - [self.avatar setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:msg.user.avatar]] placeholderImage:nil success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull image) { + [[APIClient sharedClient] fetchImageWithURL:[NSURL URLWithString:msg.user.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]; + }]; if ([msg.attach length] > 0) { CGFloat imageHeight = [msg.attachment.small.height floatValue] / [[UIScreen mainScreen] scale]; self.attachmentHeight.constant = imageHeight; |