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() } }