Skip to content

Commit

Permalink
Merge pull request #22 from hyperoslo/fix/callback
Browse files Browse the repository at this point in the history
Add UIImage in callback
  • Loading branch information
zenangst committed May 31, 2016
2 parents 6152c6b + f800c7b commit 7e122dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/Extensions/UIImageView+Imaginary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import UIKit

extension UIImageView {

public func setImage(URL: NSURL?, placeholder: UIImage? = nil, completion: (() -> ())? = nil) {
public func setImage(URL: NSURL?, placeholder: UIImage? = nil, completion: ((UIImage?) -> ())? = nil) {
image = placeholder

guard let URL = URL else { return }
Expand All @@ -20,7 +20,7 @@ extension UIImageView {
if let image = object {
dispatch_async(dispatch_get_main_queue()) {
weakSelf.image = image
completion?()
completion?(image)
}

return
Expand All @@ -39,7 +39,7 @@ extension UIImageView {
case let .Success(image):
Imaginary.transitionClosure(imageView: weakSelf, image: image)
imageCache.add(key, object: image)
completion?()
completion?(image)
default:
break
}
Expand Down

0 comments on commit 7e122dc

Please sign in to comment.