summaryrefslogtreecommitdiff
path: root/Juick/Views/MessageCell.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-03-26 15:23:50 +0300
committerGravatar Vitaly Takmazov2019-03-26 15:23:50 +0300
commit9129e92ec546499f23d6e807e3f514876eded012 (patch)
tree076231a400299e2100601479b960a46b70b86f58 /Juick/Views/MessageCell.m
parenta58828eea45ab1169203cd369a8c2c1f4c32efaf (diff)
Stop using AFNetworking image loader
Diffstat (limited to 'Juick/Views/MessageCell.m')
-rw-r--r--Juick/Views/MessageCell.m7
1 files changed, 3 insertions, 4 deletions
diff --git a/Juick/Views/MessageCell.m b/Juick/Views/MessageCell.m
index 26d74a4..551a54d 100644
--- a/Juick/Views/MessageCell.m
+++ b/Juick/Views/MessageCell.m
@@ -45,7 +45,6 @@
}
- (void) configureWithMessage:(Message *)msg {
- self.message = msg;
self.avatar.image = nil;
__weak UIImageView *weakAvatar = self.avatar;
[[APIClient sharedClient] fetchImageWithURL:[NSURL URLWithString:msg.user.avatar] callback:^(NSData *data) {
@@ -62,15 +61,15 @@
CGFloat imageHeight = [msg.attachment.medium.height floatValue] / [[UIScreen mainScreen] scale];
self.attachmentHeight.constant = imageHeight;
__weak UIImageView *weakAttach = self.attach;
- [self.attach setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:msg.attachment.medium.url]] placeholderImage:nil success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull image) {
+ [[APIClient sharedClient] fetchImageWithURL:[NSURL URLWithString:msg.attachment.medium.url] callback:^(NSData *data) {
[UIView transitionWithView:weakAttach
duration:0.3
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
- weakAttach.image = image;
+ weakAttach.image = [UIImage imageWithData:data];
}
completion:nil];
- } failure:nil];
+ }];
} else {
self.attachmentHeight.constant = 0;
self.attach.image = nil;