From 42e0feae18b5c5d3435d61ea5a7eb6b842b9361a Mon Sep 17 00:00:00 2001 From: Fnoz Date: Sat, 4 Feb 2017 16:59:13 +0800 Subject: [PATCH] (Supplement)Modify disk and download task cancel logic. --- Sources/NSButton+Kingfisher.swift | 4 ++-- Sources/UIButton+Kingfisher.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/NSButton+Kingfisher.swift b/Sources/NSButton+Kingfisher.swift index ea933c55f..c4d1e6eff 100644 --- a/Sources/NSButton+Kingfisher.swift +++ b/Sources/NSButton+Kingfisher.swift @@ -95,7 +95,7 @@ extension Kingfisher where Base: NSButton { Nothing will happen if the downloading has already finished. */ public func cancelImageDownloadTask() { - imageTask?.downloadTask?.cancel() + imageTask?.cancel() } /** @@ -164,7 +164,7 @@ extension Kingfisher where Base: NSButton { /// Cancel the alternate image download task bounded to the image view if it is running. /// Nothing will happen if the downloading has already finished. public func cancelAlternateImageDownloadTask() { - alternateImageTask?.downloadTask?.cancel() + alternateImageTask?.cancel() } } diff --git a/Sources/UIButton+Kingfisher.swift b/Sources/UIButton+Kingfisher.swift index 29933cb47..fea50efa9 100755 --- a/Sources/UIButton+Kingfisher.swift +++ b/Sources/UIButton+Kingfisher.swift @@ -99,7 +99,7 @@ extension Kingfisher where Base: UIButton { Nothing will happen if the downloading has already finished. */ public func cancelImageDownloadTask() { - imageTask?.downloadTask?.cancel() + imageTask?.cancel() } /** @@ -168,7 +168,7 @@ extension Kingfisher where Base: UIButton { Nothing will happen if the downloading has already finished. */ public func cancelBackgroundImageDownloadTask() { - backgroundImageTask?.downloadTask?.cancel() + backgroundImageTask?.cancel() } }