Sunnyyoung 7 лет назад
Родитель
Сommit
8d7c9ac005

+ 2 - 2
Sources/Filter.swift

@@ -56,8 +56,8 @@ public struct Filter {
     
     let transform: Transformer
 
-    public init(tranform: @escaping Transformer) {
-        self.transform = tranform
+    public init(transform: @escaping Transformer) {
+        self.transform = transform
     }
     
     /// Tint filter which will apply a tint color to images.

+ 1 - 1
Sources/ImageCache.swift

@@ -431,7 +431,7 @@ open class ImageCache {
     */
     open func cleanExpiredDiskCache(completion handler: (()->())? = nil) {
         
-        // Do things in cocurrent io queue
+        // Do things in concurrent io queue
         ioQueue.async {
             
             var (URLsToDelete, diskCacheSize, cachedFiles) = self.travelCachedFiles(onlyForCacheSize: false)

+ 8 - 8
Sources/ImageDownloader.swift

@@ -40,7 +40,7 @@ public typealias ImageDownloaderCompletionHandler = ((_ image: Image?, _ error:
 public struct RetrieveImageDownloadTask {
     let internalTask: URLSessionDataTask
     
-    /// Downloader by which this task is intialized.
+    /// Downloader by which this task is initialized.
     public private(set) weak var ownerDownloader: ImageDownloader?
 
     
@@ -75,7 +75,7 @@ public enum KingfisherError: Int {
     /// badData: The downloaded data is not an image or the data is corrupted.
     case badData = 10000
     
-    /// notModified: The remote server responsed a 304 code. No image data downloaded.
+    /// notModified: The remote server responded a 304 code. No image data downloaded.
     case notModified = 10001
     
     /// The HTTP status code in response is not valid. If an invalid
@@ -83,7 +83,7 @@ public enum KingfisherError: Int {
     /// in `userInfo` to see the code.
     case invalidStatusCode = 10002
     
-    /// notCached: The image rquested is not in cache but .onlyFromCache is activated.
+    /// notCached: The image requested is not in cache but .onlyFromCache is activated.
     case notCached = 10003
     
     /// The URL is invalid.
@@ -228,11 +228,11 @@ open class ImageDownloader {
     
     /// A set of trusted hosts when receiving server trust challenges. A challenge with host name contained in this set will be ignored. 
     /// You can use this set to specify the self-signed site. It only will be used if you don't specify the `authenticationChallengeResponder`. 
-    /// If `authenticationChallengeResponder` is set, this property will be ignored and the implemention of `authenticationChallengeResponder` will be used instead.
+    /// If `authenticationChallengeResponder` is set, this property will be ignored and the implementation of `authenticationChallengeResponder` will be used instead.
     open var trustedHosts: Set<String>?
     
     /// Use this to set supply a configuration for the downloader. By default, NSURLSessionConfiguration.ephemeralSessionConfiguration() will be used. 
-    /// You could change the configuration before a downloaing task starts. A configuration without persistent storage for caches is requsted for downloader working correctly.
+    /// You could change the configuration before a downloading task starts. A configuration without persistent storage for caches is requested for downloader working correctly.
     open var sessionConfiguration = URLSessionConfiguration.ephemeral {
         didSet {
             session?.invalidateAndCancel()
@@ -240,7 +240,7 @@ open class ImageDownloader {
         }
     }
     
-    /// Whether the download requests should use pipeling or not. Default is false.
+    /// Whether the download requests should use pipline or not. Default is false.
     open var requestsUsePipelining = false
     
     fileprivate let sessionHandler: ImageDownloaderSessionHandler
@@ -303,7 +303,7 @@ open class ImageDownloader {
      Download an image with a URL and option.
      
      - parameter url:               Target URL.
-     - parameter retrieveImageTask: The task to cooporate with cache. Pass `nil` if you are not trying to use downloader and cache.
+     - parameter retrieveImageTask: The task to cooperate with cache. Pass `nil` if you are not trying to use downloader and cache.
      - parameter options:           The options could control download behavior. See `KingfisherOptionsInfo`.
      - parameter progressBlock:     Called when the download progress updated.
      - parameter completionHandler: Called when the download progress finishes.
@@ -336,7 +336,7 @@ open class ImageDownloader {
             request = r
         }
         
-        // There is a possiblility that request modifier changed the url to `nil` or empty.
+        // There is a possibility that request modifier changed the url to `nil` or empty.
         guard let url = request.url, !url.absoluteString.isEmpty else {
             completionHandler?(nil, NSError(domain: KingfisherErrorDomain, code: KingfisherError.invalidURL.rawValue, userInfo: nil), nil, nil)
             return nil

+ 6 - 6
Sources/ImageProcessor.swift

@@ -45,7 +45,7 @@ public protocol ImageProcessor {
     /// Identifier of the processor. It will be used to identify the processor when 
     /// caching and retrieving an image. You might want to make sure that processors with
     /// same properties/functionality have the same identifiers, so correct processed images
-    /// could be retrived with proper key.
+    /// could be retrieved with proper key.
     /// 
     /// - Note: Do not supply an empty string for a customized processor, which is already taken by
     /// the `DefaultImageProcessor`. It is recommended to use a reverse domain name notation
@@ -63,7 +63,7 @@ public protocol ImageProcessor {
     ///         If input item is already an image and there is any errors in processing, the input 
     ///         image itself will be returned.
     /// - Note: Most processor only supports CG-based images. 
-    ///         watchOS is not supported for processers containing filter, the input image will be returned directly on watchOS.
+    ///         watchOS is not supported for processors containing filter, the input image will be returned directly on watchOS.
     func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image?
 }
 
@@ -186,7 +186,7 @@ public struct BlendImageProcessor: ImageProcessor {
     /// - parameter alpha:           Alpha will be used when blend image.
     ///                              From 0.0 to 1.0. 1.0 means solid image, 0.0 means transparent image.
     ///                              Default is 1.0.
-    /// - parameter backgroundColor: Backgroud color to apply for the output image. Default is `nil`.
+    /// - parameter backgroundColor: Background color to apply for the output image. Default is `nil`.
     public init(blendMode: CGBlendMode, alpha: CGFloat = 1.0, backgroundColor: Color? = nil) {
         self.blendMode = blendMode
         self.alpha = alpha
@@ -241,7 +241,7 @@ public struct CompositingImageProcessor: ImageProcessor {
     /// - parameter alpha:                Alpha will be used when compositing image.
     ///                                   From 0.0 to 1.0. 1.0 means solid image, 0.0 means transparent image.
     ///                                   Default is 1.0.
-    /// - parameter backgroundColor:      Backgroud color to apply for the output image. Default is `nil`.
+    /// - parameter backgroundColor:      Background color to apply for the output image. Default is `nil`.
     public init(compositingOperation: NSCompositingOperation,
                 alpha: CGFloat = 1.0,
                 backgroundColor: Color? = nil)
@@ -303,7 +303,7 @@ public struct RoundCornerImageProcessor: ImageProcessor {
     ///                              the image will keep its original size after processing.
     ///                              Default is `nil`.
     /// - parameter corners:         The target corners which will be applied rounding. Default is `.all`.
-    /// - parameter backgroundColor: Backgroud color to apply for the output image. Default is `nil`.
+    /// - parameter backgroundColor: Background color to apply for the output image. Default is `nil`.
     public init(cornerRadius: CGFloat, targetSize: CGSize? = nil, roundingCorners corners: RectCorner = .all, backgroundColor: Color? = nil) {
         self.cornerRadius = cornerRadius
         self.targetSize = targetSize
@@ -646,7 +646,7 @@ public struct CroppingImageProcessor: ImageProcessor {
     ///   It indicates a related point in current image, eg: (0.0, 0.0) for top-left
     ///   corner, (0.5, 0.5) for center and (1.0, 1.0) for bottom-right corner.
     ///   The `size` property of `CroppingImageProcessor` will be used along with
-    ///   `anchor` to calculate a target rectange in the size of image.
+    ///   `anchor` to calculate a target rectangle in the size of image.
     ///    
     ///   The target size will be automatically calculated with a reasonable behavior.
     ///   For example, when you have an image size of `CGSize(width: 100, height: 100)`,

+ 2 - 2
Sources/ImageTransition.swift

@@ -56,10 +56,10 @@ to enable the animation transition.
 
 Apple's UIViewAnimationOptions is used under the hood.
 For custom transition, you should specified your own transition options, animations and 
-comletion handler as well.
+completion handler as well.
 */
 public enum ImageTransition {
-    ///  No animation transistion.
+    ///  No animation transition.
     case none
     
     /// Fade in the loaded image.

+ 1 - 1
Sources/Indicator.swift

@@ -101,7 +101,7 @@ final class ActivityIndicator: Indicator {
 
     func startAnimatingView() {
         animatingCount += 1
-        // Alrady animating
+        // Already animating
         if animatingCount == 1 {
             #if os(macOS)
                 activityIndicatorView.startAnimation(nil)

+ 2 - 2
Sources/KingfisherOptionsInfo.swift

@@ -87,7 +87,7 @@ public enum KingfisherOptionsInfoItem {
     case backgroundDecode
     
     /// The associated value of this member will be used as the target queue of dispatch callbacks when
-    /// retrieving images from cache. If not set, `Kingfisher` will use main quese for callbacks.
+    /// retrieving images from cache. If not set, `Kingfisher` will use main queue for callbacks.
     case callbackDispatchQueue(DispatchQueue?)
     
     /// The associated value of this member will be used as the scale factor when converting retrieved data to an image.
@@ -141,7 +141,7 @@ public enum KingfisherOptionsInfoItem {
     
     /// If set and an `ImageProcessor` is used, Kingfisher will try to cache both 
     /// the final result and original image. Kingfisher will have a chance to use 
-    /// the original image when another processor is applied to the same resouce, 
+    /// the original image when another processor is applied to the same resource,
     /// instead of downloading it again.
     case cacheOriginalImage
 }