From b056b3cbe8acba6d536e56d17d91159594684692 Mon Sep 17 00:00:00 2001 From: Kevin Harwood Date: Wed, 23 Sep 2015 10:24:14 -0500 Subject: [PATCH] Fixed bug where cached image was not set if you had a completion block --- Source/UIImageView+AlamofireImage.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Source/UIImageView+AlamofireImage.swift b/Source/UIImageView+AlamofireImage.swift index 2fe93f8d..d1e020c3 100644 --- a/Source/UIImageView+AlamofireImage.swift +++ b/Source/UIImageView+AlamofireImage.swift @@ -301,12 +301,8 @@ extension UIImageView { // Use the image from the image cache if it exists if let image = imageCache?.imageForRequest(URLRequest.URLRequest, withAdditionalIdentifier: filter?.identifier) { - if let completion = completion { - completion(URLRequest.URLRequest, nil, .Success(image)) - } else { - self.image = image - } - + completion?(URLRequest.URLRequest, nil, .Success(image)) + self.image = image return }