summaryrefslogtreecommitdiff
path: root/Juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-03-26 10:49:28 +0300
committerGravatar Vitaly Takmazov2019-03-26 10:49:28 +0300
commitb07a19228bcb98b4b43aaa2cb85548f4fc80a2aa (patch)
treeb14f321d6e3c5fb4b94e632afd917b9ac8c1f16f /Juick
parent2153ebb31087896c3e257d1d65060d72ba2cf649 (diff)
Medium photos and placeholders
Diffstat (limited to 'Juick')
-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