From 045412a5312546769f452c3b66a2bae9d44105fe Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 16 Oct 2018 21:04:49 +0300 Subject: YYWebImage -> AFNetworking --- Juick.xcodeproj/project.pbxproj | 6 ------ Juick/Supporting Files/Juick-Info.plist | 2 +- Juick/Views/BubbleMessageCell.m | 13 +++++++++++-- Juick/Views/ConversationCell.m | 13 +++++++++++-- Juick/Views/MessageCell.m | 24 +++++++++++++++++++++--- Podfile | 1 - Podfile.lock | 16 +--------------- 7 files changed, 45 insertions(+), 30 deletions(-) diff --git a/Juick.xcodeproj/project.pbxproj b/Juick.xcodeproj/project.pbxproj index 5def70f..72dafb0 100644 --- a/Juick.xcodeproj/project.pbxproj +++ b/Juick.xcodeproj/project.pbxproj @@ -466,10 +466,7 @@ "${BUILT_PRODUCTS_DIR}/PHFDelegateChain/PHFDelegateChain.framework", "${BUILT_PRODUCTS_DIR}/TTTAttributedLabel/TTTAttributedLabel.framework", "${BUILT_PRODUCTS_DIR}/TagListView-ObjC/TagListView_ObjC.framework", - "${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework", - "${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework", "${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework", - "${BUILT_PRODUCTS_DIR}/YYWebImage/YYWebImage.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( @@ -481,10 +478,7 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PHFDelegateChain.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TTTAttributedLabel.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TagListView_ObjC.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCache.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYImage.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYModel.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYWebImage.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/Juick/Supporting Files/Juick-Info.plist b/Juick/Supporting Files/Juick-Info.plist index 002d172..d42d202 100644 --- a/Juick/Supporting Files/Juick-Info.plist +++ b/Juick/Supporting Files/Juick-Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 68 + 69 ITSAppUsesNonExemptEncryption LSApplicationCategoryType diff --git a/Juick/Views/BubbleMessageCell.m b/Juick/Views/BubbleMessageCell.m index b201664..33a4206 100644 --- a/Juick/Views/BubbleMessageCell.m +++ b/Juick/Views/BubbleMessageCell.m @@ -8,7 +8,7 @@ #import "BubbleMessageCell.h" #import "ColorScheme.h" -@import YYWebImage; +@import AFNetworking; @implementation BubbleMessageCell @@ -27,7 +27,16 @@ self.name.text = message.user.uname; self.message.text = message.text; self.unreadMarker.text = @""; - [self.avatarView yy_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [message.user.uid intValue]]] options:YYWebImageOptionProgressiveBlur|YYWebImageOptionSetImageWithFadeAnimation]; + __weak UIImageView *weakAvatar = self.avatarView; + [self.avatarView setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [message.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]; self.message.enabledTextCheckingTypes = NSTextCheckingTypeLink; self.message.backgroundColor = [ColorScheme mainBackground]; self.message.layer.cornerRadius = 4; diff --git a/Juick/Views/ConversationCell.m b/Juick/Views/ConversationCell.m index 750ab45..780e74a 100644 --- a/Juick/Views/ConversationCell.m +++ b/Juick/Views/ConversationCell.m @@ -7,7 +7,7 @@ // #import "ConversationCell.h" -@import YYWebImage; +@import AFNetworking; @implementation ConversationCell @@ -20,7 +20,16 @@ self.chatName.text = chat.uname; self.lastMessage.text = @""; self.unreadMarker.text = @""; - [self.avatar yy_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [chat.uid intValue]]] options:YYWebImageOptionProgressiveBlur|YYWebImageOptionSetImageWithFadeAnimation]; + __weak UIImageView *weakAvatar; + [self.avatar setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [chat.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]; } @end 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; diff --git a/Podfile b/Podfile index 68fc736..4c662ba 100644 --- a/Podfile +++ b/Podfile @@ -8,7 +8,6 @@ target "Juick" do pod 'TTTAttributedLabel' pod 'PDKeychainBindingsController' pod 'YYModel' - pod 'YYWebImage' pod 'DateTools' pod 'TagListView-ObjC' pod 'PHFComposeBarView' diff --git a/Podfile.lock b/Podfile.lock index 50ec1cd..6f42ddd 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -30,14 +30,7 @@ PODS: - PHFDelegateChain (1.0.1) - TagListView-ObjC (0.1.1) - TTTAttributedLabel (2.0.0) - - YYCache (1.0.4) - - YYImage (1.0.4): - - YYImage/Core (= 1.0.4) - - YYImage/Core (1.0.4) - YYModel (1.0.4) - - YYWebImage (1.0.5): - - YYCache - - YYImage DEPENDENCIES: - AFNetworking @@ -48,7 +41,6 @@ DEPENDENCIES: - TagListView-ObjC - TTTAttributedLabel - YYModel - - YYWebImage SPEC REPOS: https://github.com/cocoapods/specs.git: @@ -60,10 +52,7 @@ SPEC REPOS: - PHFDelegateChain - TagListView-ObjC - TTTAttributedLabel - - YYCache - - YYImage - YYModel - - YYWebImage SPEC CHECKSUMS: AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057 @@ -74,11 +63,8 @@ SPEC CHECKSUMS: PHFDelegateChain: 491f9cd8a3fb8761f390ff05f74a0e168d48d285 TagListView-ObjC: 432991e24c5177eb4fa7d721de7084f09f39a0b8 TTTAttributedLabel: 8cffe8e127e4e82ff3af1e5386d4cd0ad000b656 - YYCache: 8105b6638f5e849296c71f331ff83891a4942952 - YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30 - YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928 -PODFILE CHECKSUM: 549f6e80e7e48860145b72aec2fc2fb77ee039ee +PODFILE CHECKSUM: ddfb05518472010448e3f652b18088e3a340f05a COCOAPODS: 1.5.3 -- cgit v1.2.3