summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Juick/Juick-Prefix.pch2
-rw-r--r--Juick/MessagesViewController.m9
-rw-r--r--Juick/Views/MessageCell.m2
-rw-r--r--Juick/Views/MessageCell.xib2
-rw-r--r--Podfile2
-rw-r--r--Podfile.lock21
6 files changed, 24 insertions, 14 deletions
diff --git a/Juick/Juick-Prefix.pch b/Juick/Juick-Prefix.pch
index 7836550..c48dc95 100644
--- a/Juick/Juick-Prefix.pch
+++ b/Juick/Juick-Prefix.pch
@@ -15,7 +15,7 @@
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
- #import <UIImageView+DFImageManager.h>
+ #import <YYWebImage.h>
#import "NSString+HTML.h"
#import "UIImage+Utils.h"
#import "NSDate+TimeAgo.h"
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;
}
diff --git a/Juick/Views/MessageCell.m b/Juick/Views/MessageCell.m
index 65565a8..7117052 100644
--- a/Juick/Views/MessageCell.m
+++ b/Juick/Views/MessageCell.m
@@ -23,7 +23,7 @@
- (void) setMessage:(Message *)msg {
_message = msg;
- [self.avatar df_setImageWithResource:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [msg.userID intValue]]]];
+ self.avatar.yy_imageURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [msg.userID intValue]]];
self.title.text = msg.user;
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
diff --git a/Juick/Views/MessageCell.xib b/Juick/Views/MessageCell.xib
index 29f37fb..5cbf69d 100644
--- a/Juick/Views/MessageCell.xib
+++ b/Juick/Views/MessageCell.xib
@@ -52,7 +52,7 @@
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
- <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="53j-SC-IXj">
+ <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="53j-SC-IXj">
<rect key="frame" x="0.0" y="249" width="50" height="50"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zDd-8E-ic8">
diff --git a/Podfile b/Podfile
index 0bc7b0c..eb20b2c 100644
--- a/Podfile
+++ b/Podfile
@@ -7,7 +7,7 @@ target "Juick" do
pod 'SWRevealViewController'
pod 'PDKeychainBindingsController'
pod 'RestKit', '~> 0.26.0'
- pod 'DFImageManager'
+ pod 'YYWebImage'
pod 'FontAwesome+iOS'
pod 'NSDate+TimeAgo'
pod 'SIAlertView'
diff --git a/Podfile.lock b/Podfile.lock
index 4903e8e..9f8acf8 100644
--- a/Podfile.lock
+++ b/Podfile.lock
@@ -1,11 +1,5 @@
PODS:
- AFNetworking (1.3.4)
- - DFImageManager (2.0.1):
- - DFImageManager/Core (= 2.0.1)
- - DFImageManager/UI (= 2.0.1)
- - DFImageManager/Core (2.0.1)
- - DFImageManager/UI (2.0.1):
- - DFImageManager/Core
- FontAwesome+iOS (0.1.4)
- ISO8601DateFormatterValueTransformer (0.6.1):
- RKValueTransformers (~> 1.1.0)
@@ -46,9 +40,15 @@ PODS:
- TransitionKit (2.2.1)
- TTTAttributedLabel (2.0.0)
- XLForm (3.2.0)
+ - YYCache (1.0.3)
+ - YYImage (1.0.3):
+ - YYImage/Core (= 1.0.3)
+ - YYImage/Core (1.0.3)
+ - YYWebImage (1.0.4):
+ - YYCache
+ - YYImage
DEPENDENCIES:
- - DFImageManager
- FontAwesome+iOS
- MWFeedParser
- NSDate+TimeAgo
@@ -58,10 +58,10 @@ DEPENDENCIES:
- SWRevealViewController
- TTTAttributedLabel
- XLForm
+ - YYWebImage
SPEC CHECKSUMS:
AFNetworking: cf8e418e16f0c9c7e5c3150d019a3c679d015018
- DFImageManager: c19b62a3e15d89f3532ae6fdb222531ec7e811b1
FontAwesome+iOS: 9070b682a9255ca0fdc34bcfb129ad0ba2b73b87
ISO8601DateFormatterValueTransformer: 52da467d6ec899d6aedda8e48280ac92e8ee97e6
MWFeedParser: 2cf646014c1baf6ad1b08c480b40a08180079247
@@ -75,7 +75,10 @@ SPEC CHECKSUMS:
TransitionKit: 9ceccda4cd0cdc0a05ef85eb235e5a3292c3c250
TTTAttributedLabel: 8cffe8e127e4e82ff3af1e5386d4cd0ad000b656
XLForm: 2250b4e96ab8ffa5f3355838c79edd90de451782
+ YYCache: 282f35b5b0990833d0b7a06d864a87141a021da2
+ YYImage: 362f44ffba1fc498f2152060f3bb54ed84600981
+ YYWebImage: 0431ed108e104527669b86f75efd58958425cca2
-PODFILE CHECKSUM: de7137f8c5e20473136582ff4c6b99b9e14b2b81
+PODFILE CHECKSUM: db78270e2bbf27b53486a73376f9be8ccd0a4c45
COCOAPODS: 1.0.1