diff --git a/Sources/ImageDownloader.swift b/Sources/ImageDownloader.swift index 25489b83f..7dfb7fabe 100644 --- a/Sources/ImageDownloader.swift +++ b/Sources/ImageDownloader.swift @@ -113,12 +113,12 @@ public protocol AuthenticationChallengeResponable: class { - Note: This method is a forward from `URLSession(:didReceiveChallenge:completionHandler:)`. Please refer to the document of it in `NSURLSessionDelegate`. */ - func downloder(downloader: ImageDownloader, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) + func downloader(downloader: ImageDownloader, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) } extension AuthenticationChallengeResponable { - func downloder(downloader: ImageDownloader, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) { + func downloader(downloader: ImageDownloader, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) { if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { if let trustedHosts = downloader.trustedHosts where trustedHosts.contains(challenge.protectionSpace.host) { @@ -269,7 +269,7 @@ extension ImageDownloader { progressBlock: ImageDownloaderProgressBlock?, completionHandler: ImageDownloaderCompletionHandler?) -> RetrieveImageDownloadTask? { - if let retrieveImageTask = retrieveImageTask where retrieveImageTask.cancelledBeforeDownlodStarting { + if let retrieveImageTask = retrieveImageTask where retrieveImageTask.cancelledBeforeDownloadStarting { return nil } @@ -411,7 +411,7 @@ class ImageDownloaderSessionHandler: NSObject, NSURLSessionDataDelegate, Authent return } - downloader.authenticationChallengeResponder?.downloder(downloader, didReceiveChallenge: challenge, completionHandler: completionHandler) + downloader.authenticationChallengeResponder?.downloader(downloader, didReceiveChallenge: challenge, completionHandler: completionHandler) } private func callbackWithImage(image: Image?, error: NSError?, imageURL: NSURL, originalData: NSData?) { diff --git a/Sources/KingfisherManager.swift b/Sources/KingfisherManager.swift index 4850d7be8..6facfd100 100644 --- a/Sources/KingfisherManager.swift +++ b/Sources/KingfisherManager.swift @@ -39,7 +39,7 @@ public class RetrieveImageTask { // If task is canceled before the download task started (which means the `downloadTask` is nil), // the download task should not begin. - var cancelledBeforeDownlodStarting: Bool = false + var cancelledBeforeDownloadStarting: Bool = false /// The disk retrieve task in this image task. Kingfisher will try to look up in cache first. This task represent the cache search task. public var diskRetrieveTask: RetrieveImageDiskTask? @@ -61,7 +61,7 @@ public class RetrieveImageTask { if let downloadTask = downloadTask { downloadTask.cancel() } else { - cancelledBeforeDownlodStarting = true + cancelledBeforeDownloadStarting = true } } }