From 8cdfd406de0b1c9d9f70581bbcc610f0b2b20555 Mon Sep 17 00:00:00 2001 From: Jan Misar Date: Thu, 2 Mar 2017 14:01:16 +0100 Subject: [PATCH] Update SDWebImage extension for 4.0+. --- ACKReactiveExtensions.podspec | 2 +- .../SDWebImage/SDWebImage+RAC.swift | 8 ++- Example/Podfile.lock | 60 +++++++++---------- 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/ACKReactiveExtensions.podspec b/ACKReactiveExtensions.podspec index 8a5ef75..0e16c96 100644 --- a/ACKReactiveExtensions.podspec +++ b/ACKReactiveExtensions.podspec @@ -49,7 +49,7 @@ Pod::Spec.new do |s| s.subspec 'SDWebImage' do |sdwebimage| sdwebimage.dependency 'ACKReactiveExtensions/Core' - sdwebimage.dependency 'SDWebImage' + sdwebimage.dependency 'SDWebImage', '~> 4.0' sdwebimage.source_files = 'ACKReactiveExtensions/SDWebImage/**/*' end diff --git a/ACKReactiveExtensions/SDWebImage/SDWebImage+RAC.swift b/ACKReactiveExtensions/SDWebImage/SDWebImage+RAC.swift index 64f9d5c..9a4ca30 100644 --- a/ACKReactiveExtensions/SDWebImage/SDWebImage+RAC.swift +++ b/ACKReactiveExtensions/SDWebImage/SDWebImage+RAC.swift @@ -22,7 +22,9 @@ extension Reactive where Base: SDWebImageDownloader { sink.sendCompleted() } disposable.add({ - task?.cancel() + if let token = task?.downloadOperationCancelToken as? SDWebImageDownloadToken { + self.base.cancel(token) + } }) } } @@ -55,7 +57,9 @@ extension SDWebImageDownloader { sink.sendCompleted() } disposable.add({ - task?.cancel() + if let token = task?.downloadOperationCancelToken as? SDWebImageDownloadToken { + self.cancel(token) + } }) } } diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 92dc759..b1f10c5 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,39 +1,39 @@ PODS: - - ACKReactiveExtensions (2.2.2): - - ACKReactiveExtensions/Core (= 2.2.2) - - ACKReactiveExtensions/UIKit (= 2.2.2) - - ReactiveCocoa (~> 5.0.0-rc.1) - - ACKReactiveExtensions/Argo (2.2.2): + - ACKReactiveExtensions (2.3.0): + - ACKReactiveExtensions/Core (= 2.3.0) + - ACKReactiveExtensions/UIKit (= 2.3.0) + - ReactiveCocoa (~> 5.0) + - ACKReactiveExtensions/Argo (2.3.0): - Argo (~> 4.0) - - ReactiveCocoa (~> 5.0.0-rc.1) - - ACKReactiveExtensions/Core (2.2.2): - - ReactiveCocoa (~> 5.0.0-rc.1) - - ACKReactiveExtensions/Reachability (2.2.2): + - ReactiveCocoa (~> 5.0) + - ACKReactiveExtensions/Core (2.3.0): + - ReactiveCocoa (~> 5.0) + - ACKReactiveExtensions/Reachability (2.3.0): - ACKReactiveExtensions/Core - Reachability - - ReactiveCocoa (~> 5.0.0-rc.1) - - ACKReactiveExtensions/Realm (2.2.2): + - ReactiveCocoa (~> 5.0) + - ACKReactiveExtensions/Realm (2.3.0): - ACKReactiveExtensions/Core - - ReactiveCocoa (~> 5.0.0-rc.1) + - ReactiveCocoa (~> 5.0) - RealmSwift (~> 2.1) - - ACKReactiveExtensions/SDWebImage (2.2.2): + - ACKReactiveExtensions/SDWebImage (2.3.0): - ACKReactiveExtensions/Core - - ReactiveCocoa (~> 5.0.0-rc.1) + - ReactiveCocoa (~> 5.0) - SDWebImage - - ACKReactiveExtensions/UIKit (2.2.2): + - ACKReactiveExtensions/UIKit (2.3.0): - ACKReactiveExtensions/Core - - ReactiveCocoa (~> 5.0.0-rc.1) - - ACKReactiveExtensions/WebKit (2.2.2): + - ReactiveCocoa (~> 5.0) + - ACKReactiveExtensions/WebKit (2.3.0): - ACKReactiveExtensions/Core - - ReactiveCocoa (~> 5.0.0-rc.1) + - ReactiveCocoa (~> 5.0) - Argo (4.1.1): - Runes (>= 4.0.0) - Nimble (5.1.1) - Quick (0.10.0) - Reachability (3.2) - - ReactiveCocoa (5.0.0-rc.1): - - ReactiveSwift (~> 1.0.0-rc.3) - - ReactiveSwift (1.0.0): + - ReactiveCocoa (5.0.1): + - ReactiveSwift (~> 1.1) + - ReactiveSwift (1.1.0): - Result (~> 3.1) - Realm (2.1.2): - Realm/Headers (= 2.1.2) @@ -42,9 +42,9 @@ PODS: - Realm (= 2.1.2) - Result (3.1.0) - Runes (4.0.1) - - SDWebImage (3.8.2): - - SDWebImage/Core (= 3.8.2) - - SDWebImage/Core (3.8.2) + - SDWebImage (4.0.0): + - SDWebImage/Core (= 4.0.0) + - SDWebImage/Core (4.0.0) DEPENDENCIES: - ACKReactiveExtensions (from `../`) @@ -59,22 +59,22 @@ DEPENDENCIES: EXTERNAL SOURCES: ACKReactiveExtensions: - :path: ../ + :path: "../" SPEC CHECKSUMS: - ACKReactiveExtensions: c9b0a363ba76fe47dfdb074fb7da40ef988f0bf7 + ACKReactiveExtensions: 19813af5a953c3d48f6aa553c28350e5730d52c5 Argo: 014ac072f97462bc1a9b83d302edb351488a532f Nimble: 415e3aa3267e7bc2c96b05fa814ddea7bb686a29 Quick: 5d290df1c69d5ee2f0729956dcf0fd9a30447eaa Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 - ReactiveCocoa: 3e9cad4b77fa199d41e03f603cb55d0701ad6ad8 - ReactiveSwift: f391724ee318a2cfd3e37dfb041cd49ecf4e7869 + ReactiveCocoa: f577006aa6c7b0b08020109ebaae3b77ada00adc + ReactiveSwift: 2f4e4a02e5a5c87ea63f5fe667163ce2a67cbb57 Realm: efe855f4d977c8ce5a82d3116d9f1ff155a6550c RealmSwift: 17d6ee30b6f9df86364408c2197492e33bfea567 Result: 4e3ed5995ed94d0cd6a09be9a431fce3f3624bbf Runes: ff20f163b478ac2c0e18158d6086fd5b1997f983 - SDWebImage: 098e97e6176540799c27e804c96653ee0833d13c + SDWebImage: 76a6348bdc74eb5a55dd08a091ef298e56b55e41 PODFILE CHECKSUM: 1ed247216cfa78d69af7c9aed3f2ed92db7fcd17 -COCOAPODS: 1.2.0.rc.1 +COCOAPODS: 1.2.0