From b07a19228bcb98b4b43aaa2cb85548f4fc80a2aa Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 26 Mar 2019 10:49:28 +0300 Subject: Medium photos and placeholders --- Juick/Views/MessageCell.m | 5 +++-- 1 file 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 -- cgit v1.2.3