Browse Source

单词错误 extral -> extra

Jack 5 years ago
parent
commit
d26aee4373
2 changed files with 14 additions and 14 deletions
  1. 2 2
      Sources/Networking/ImageDownloader.swift
  2. 12 12
      Sources/Networking/SessionDelegate.swift

+ 2 - 2
Sources/Networking/ImageDownloader.swift

@@ -165,9 +165,9 @@ open class ImageDownloader {
         setupSessionHandler()
     }
     
-    /// You could set the extral handler before a downloading task starts.
+    /// You could set the extra handler before a downloading task starts.
     public func addExtraSessionDelegateHandler(_ handler: URLSessionDataDelegate) {
-        sessionDelegate.extralHandler = handler
+        sessionDelegate.extraHandler = handler
     }
     
     deinit { session.invalidateAndCancel() }

+ 12 - 12
Sources/Networking/SessionDelegate.swift

@@ -45,7 +45,7 @@ class SessionDelegate: NSObject {
 
     private var tasks: [URL: SessionDataTask] = [:]
     private let lock = NSLock()
-    public var extralHandler: URLSessionDataDelegate?
+    public var extraHandler: URLSessionDataDelegate?
 
     let onValidStatusCode = Delegate<Int, Bool>()
     let onDownloadingFinished = Delegate<(URL, Result<URLResponse, KingfisherError>), Void>()
@@ -262,41 +262,41 @@ extension SessionDelegate: URLSessionDataDelegate {
     }
     
     
-    // MARK: - ExtralHandler
+    // MARK: - extraHandler
     @available(iOS 7.0, OSX 11.0, tvOS 9.0, watchOS 2.0, *)
     func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) {
-        extralHandler?.urlSessionDidFinishEvents?(forBackgroundURLSession: session)
+        extraHandler?.urlSessionDidFinishEvents?(forBackgroundURLSession: session)
     }
     func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) {
-        extralHandler?.urlSession?(session, didBecomeInvalidWithError: error)
+        extraHandler?.urlSession?(session, didBecomeInvalidWithError: error)
     }
     @available(iOS 11.0, OSX 10.13, tvOS 11.0, watchOS 4.0, *)
     func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask) {
-        extralHandler?.urlSession?(session, taskIsWaitingForConnectivity: task)
+        extraHandler?.urlSession?(session, taskIsWaitingForConnectivity: task)
     }
     @available(iOS 10.0, OSX 10.12, tvOS 10.0, watchOS 3.0, *)
     func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) {
-        extralHandler?.urlSession?(session, task: task, didFinishCollecting: metrics)
+        extraHandler?.urlSession?(session, task: task, didFinishCollecting: metrics)
     }
     @available(iOS 9.0, OSX 10.11, tvOS 9.0, watchOS 2.0, *)
     func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) {
-        extralHandler?.urlSession?(session, dataTask: dataTask, didBecome: streamTask)
+        extraHandler?.urlSession?(session, dataTask: dataTask, didBecome: streamTask)
     }
     func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) {
-        extralHandler?.urlSession?(session, dataTask: dataTask, didBecome: downloadTask)
+        extraHandler?.urlSession?(session, dataTask: dataTask, didBecome: downloadTask)
     }
     func urlSession(_ session: URLSession, task: URLSessionTask, needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) {
-        extralHandler?.urlSession?(session, task: task, needNewBodyStream: completionHandler)
+        extraHandler?.urlSession?(session, task: task, needNewBodyStream: completionHandler)
     }
     func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) {
-        extralHandler?.urlSession?(session, task: task, didSendBodyData: bytesSent, totalBytesSent: totalBytesSent, totalBytesExpectedToSend: totalBytesExpectedToSend)
+        extraHandler?.urlSession?(session, task: task, didSendBodyData: bytesSent, totalBytesSent: totalBytesSent, totalBytesExpectedToSend: totalBytesExpectedToSend)
     }
     func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse, completionHandler: @escaping (CachedURLResponse?) -> Void) {
-        extralHandler?.urlSession?(session, dataTask: dataTask, willCacheResponse: proposedResponse, completionHandler: completionHandler)
+        extraHandler?.urlSession?(session, dataTask: dataTask, willCacheResponse: proposedResponse, completionHandler: completionHandler)
     }
     @available(iOS 11.0, OSX 10.13, tvOS 11.0, watchOS 4.0, *)
     func urlSession(_ session: URLSession, task: URLSessionTask, willBeginDelayedRequest request: URLRequest, completionHandler: @escaping (URLSession.DelayedRequestDisposition, URLRequest?) -> Void) {
-        extralHandler?.urlSession?(session, task: task, willBeginDelayedRequest: request, completionHandler: completionHandler)
+        extraHandler?.urlSession?(session, task: task, willBeginDelayedRequest: request, completionHandler: completionHandler)
     }
     
 }