summaryrefslogtreecommitdiff
path: root/Juick/MessagesViewController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/MessagesViewController.m')
-rw-r--r--Juick/MessagesViewController.m9
1 files changed, 8 insertions, 1 deletions
diff --git a/Juick/MessagesViewController.m b/Juick/MessagesViewController.m
index 91833e1..343bb2c 100644
--- a/Juick/MessagesViewController.m
+++ b/Juick/MessagesViewController.m
@@ -129,7 +129,14 @@ static NSString *CellIdentifier = @"MessageCell";
Message *msg = [_messages objectAtIndex:indexPath.row];
[cell setMessage:msg];
if ([msg.attach length] > 0) {
- [cell.attach df_setImageWithResource:[NSURL URLWithString:msg.attach]];
+ __weak MessagesViewController * weakSelf = self;
+ [cell.attach yy_setImageWithURL:[NSURL URLWithString:msg.attach] placeholder:[UIImage imageNamed:@"AttachPlaceholder"] options:YYWebImageOptionProgressiveBlur | YYWebImageOptionSetImageWithFadeAnimation completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
+ [cell setNeedsUpdateConstraints];
+ [cell updateConstraintsIfNeeded];
+ [cell setNeedsLayout];
+ [cell layoutIfNeeded];
+ }];
+
} else {
cell.attach.image = nil;
}