summaryrefslogtreecommitdiff
path: root/Juick/Views/MessageCell.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-16 21:04:49 +0300
committerGravatar Vitaly Takmazov2018-10-16 21:04:49 +0300
commit045412a5312546769f452c3b66a2bae9d44105fe (patch)
treee6fd2ece98d7f22391a0dd2a2a8713bce5192d77 /Juick/Views/MessageCell.m
parent7a7fd7bef91431be0c8c93a138a292deea7b4328 (diff)
YYWebImage -> AFNetworking
Diffstat (limited to 'Juick/Views/MessageCell.m')
-rw-r--r--Juick/Views/MessageCell.m24
1 files changed, 21 insertions, 3 deletions
diff --git a/Juick/Views/MessageCell.m b/Juick/Views/MessageCell.m
index c304f37..4b08190 100644
--- a/Juick/Views/MessageCell.m
+++ b/Juick/Views/MessageCell.m
@@ -13,7 +13,7 @@
@import DateTools;
@import MWFeedParser;
-@import YYWebImage;
+@import AFNetworking;
@implementation MessageCell
@@ -35,11 +35,29 @@
}
- (void) configureWithMessage:(Message *)msg {
- [self.avatar yy_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [msg.user.uid intValue]]] options:YYWebImageOptionProgressiveBlur|YYWebImageOptionSetImageWithFadeAnimation];
+ __weak UIImageView *weakAvatar = self.avatar;
+ [self.avatar setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [msg.user.uid intValue]]]] placeholderImage:nil success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull image) {
+ [UIView transitionWithView:weakAvatar
+ duration:0.3
+ options:UIViewAnimationOptionTransitionCrossDissolve
+ animations:^{
+ weakAvatar.image = image;
+ }
+ completion:nil];
+ } failure:nil];
if ([msg.attach length] > 0) {
CGFloat imageHeight = [msg.attachment.small.height floatValue] / [[UIScreen mainScreen] scale];
self.attachmentHeight.constant = imageHeight;
- [self.attach yy_setImageWithURL:[NSURL URLWithString:msg.attach] options:YYWebImageOptionProgressiveBlur|YYWebImageOptionSetImageWithFadeAnimation];
+ __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) {
+ [UIView transitionWithView:weakAttach
+ duration:0.3
+ options:UIViewAnimationOptionTransitionCrossDissolve
+ animations:^{
+ weakAttach.image = image;
+ }
+ completion:nil];
+ } failure:nil];
} else {
self.attachmentHeight.constant = 0;
self.attach.image = nil;