Skip to content

Commit

Permalink
Merge pull request #580 from Fnoz/fix/cancelDownloadTask
Browse files Browse the repository at this point in the history
(Supplement)Modify disk and download task cancel logic.
  • Loading branch information
onevcat authored Feb 5, 2017
2 parents 8c9d3f6 + 42e0fea commit d11dbb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/NSButton+Kingfisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

/**
Expand Down Expand Up @@ -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()
}
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/UIButton+Kingfisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

/**
Expand Down Expand Up @@ -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()
}

}
Expand Down

0 comments on commit d11dbb9

Please sign in to comment.