summaryrefslogtreecommitdiff
path: root/Juick/Views/MessageCell.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/Views/MessageCell.m')
-rw-r--r--Juick/Views/MessageCell.m5
1 files changed, 3 insertions, 2 deletions
diff --git a/Juick/Views/MessageCell.m b/Juick/Views/MessageCell.m
index fc7a821..26d74a4 100644
--- a/Juick/Views/MessageCell.m
+++ b/Juick/Views/MessageCell.m
@@ -58,10 +58,11 @@
completion:nil];
}];
if ([msg.attach length] > 0) {
- CGFloat imageHeight = [msg.attachment.small.height floatValue] / [[UIScreen mainScreen] scale];
+ self.attach.image = [UIImage placeholderImageWithColor:[UIColor colorNamed:@"Muted"] size:CGSizeMake([msg.attachment.medium.width floatValue], [msg.attachment.medium.height floatValue])];
+ 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.attach]] placeholderImage:nil success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull image) {
+ [self.attach setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:msg.attachment.medium.url]] placeholderImage:nil success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull image) {
[UIView transitionWithView:weakAttach
duration:0.3
options:UIViewAnimationOptionTransitionCrossDissolve