From 10784790574119675cc0ef6693cafc19688df864 Mon Sep 17 00:00:00 2001 From: nixzhu Date: Thu, 3 Dec 2015 17:05:35 +0800 Subject: [PATCH] socialWorkImageView --- Yep/Configs/YepConfig.swift | 6 ++++++ Yep/Extensions/UIImageView+Yep.swift | 2 +- Yep/Views/Cells/FeedSocialWork/FeedSocialWorkCell.swift | 2 +- Yep/Views/Cells/InstagramMedia/InstagramMediaCell.swift | 5 ----- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Yep/Configs/YepConfig.swift b/Yep/Configs/YepConfig.swift index fc374df3..164a9400 100644 --- a/Yep/Configs/YepConfig.swift +++ b/Yep/Configs/YepConfig.swift @@ -9,6 +9,12 @@ import UIKit import Ruler import CoreLocation +import Kingfisher + +let MediaOptionsInfos: KingfisherOptionsInfo = [ + .Options([.BackgroundDecode, .LowPriority]), + .Transition(ImageTransition.Fade(0.3)) +] class YepConfig { diff --git a/Yep/Extensions/UIImageView+Yep.swift b/Yep/Extensions/UIImageView+Yep.swift index 37fce7c2..539b6d66 100644 --- a/Yep/Extensions/UIImageView+Yep.swift +++ b/Yep/Extensions/UIImageView+Yep.swift @@ -34,7 +34,7 @@ extension UIImageView { return } - UIView.transitionWithView(strongSelf, duration: 0.5, options: .TransitionCrossDissolve, animations: { () -> Void in + UIView.transitionWithView(strongSelf, duration: 0.3, options: .TransitionCrossDissolve, animations: { () -> Void in strongSelf.image = image }, completion: nil) }) diff --git a/Yep/Views/Cells/FeedSocialWork/FeedSocialWorkCell.swift b/Yep/Views/Cells/FeedSocialWork/FeedSocialWorkCell.swift index dbe2b087..8bbf871e 100644 --- a/Yep/Views/Cells/FeedSocialWork/FeedSocialWorkCell.swift +++ b/Yep/Views/Cells/FeedSocialWork/FeedSocialWorkCell.swift @@ -349,7 +349,7 @@ class FeedSocialWorkCell: FeedBasicCell { } if let URL = socialWorkImageURL { - socialWorkImageView.kf_setImageWithURL(URL, placeholderImage: nil) + socialWorkImageView.kf_setImageWithURL(URL, placeholderImage: nil, optionsInfo: MediaOptionsInfos) } } diff --git a/Yep/Views/Cells/InstagramMedia/InstagramMediaCell.swift b/Yep/Views/Cells/InstagramMedia/InstagramMediaCell.swift index f70e7381..f1425fa4 100644 --- a/Yep/Views/Cells/InstagramMedia/InstagramMediaCell.swift +++ b/Yep/Views/Cells/InstagramMedia/InstagramMediaCell.swift @@ -9,11 +9,6 @@ import UIKit import Kingfisher -let MediaOptionsInfos: KingfisherOptionsInfo = [ - .Options([.BackgroundDecode, .LowPriority]), - .Transition(ImageTransition.Fade(0.55)) -] - class InstagramMediaCell: UICollectionViewCell { @IBOutlet weak var imageView: UIImageView!