Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
RAC Extension for ReactiveCocoa
import Kingfisher
import ReactiveCocoa
import enum Result.NoError
extension KingfisherManager {
func rac_retrieveImageWithURL(URL: NSURL,
optionsInfo: KingfisherOptionsInfo?,
progressBlock: DownloadProgressBlock?) -> SignalProducer<(image: UIImage?, cacheType: CacheType, imageURL: NSURL?), NSError> {
return SignalProducer { observer, disposable in
let imageTask = KingfisherManager.sharedManager.retrieveImageWithURL(URL, optionsInfo: optionsInfo, progressBlock: progressBlock) { (image, error, cacheType, imageURL) -> () in
if let error = error {
} else {
observer.sendNext(image: image, cacheType: cacheType, imageURL: imageURL)
disposable.addDisposable {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.