Преглед изворни кода

Add docs for new public APIs

onevcat пре 4 година
родитељ
комит
9756900223
2 измењених фајлова са 5 додато и 4 уклоњено
  1. 4 4
      Sources/Image/GIFAnimatedImage.swift
  2. 1 0
      Sources/Image/Image.swift

+ 4 - 4
Sources/Image/GIFAnimatedImage.swift

@@ -68,8 +68,8 @@ public struct ImageCreatingOptions {
     }
 }
 
-// Represents the decoding for a GIF image. This class extracts frames from an `imageSource`, then
-// hold the images for later use.
+/// Represents the decoding for a GIF image. This class extracts frames from an `imageSource`, then
+/// hold the images for later use.
 public class GIFAnimatedImage {
     let images: [KFCrossPlatformImage]
     let duration: TimeInterval
@@ -97,7 +97,7 @@ public class GIFAnimatedImage {
         self.duration = gifDuration
     }
     
-    // Calculates frame duration for a gif frame out of the kCGImagePropertyGIFDictionary dictionary.
+    /// Calculates frame duration for a gif frame out of the kCGImagePropertyGIFDictionary dictionary.
     public static func getFrameDuration(from gifInfo: [String: Any]?) -> TimeInterval {
         let defaultFrameDuration = 0.1
         guard let gifInfo = gifInfo else { return defaultFrameDuration }
@@ -110,7 +110,7 @@ public class GIFAnimatedImage {
         return frameDuration.doubleValue > 0.011 ? frameDuration.doubleValue : defaultFrameDuration
     }
 
-    // Calculates frame duration at a specific index for a gif from an `imageSource`.
+    /// Calculates frame duration at a specific index for a gif from an `imageSource`.
     public static func getFrameDuration(from imageSource: CGImageSource, at index: Int) -> TimeInterval {
         guard let properties = CGImageSourceCopyPropertiesAtIndex(imageSource, index, nil)
             as? [String: Any] else { return 0.0 }

+ 1 - 0
Sources/Image/Image.swift

@@ -90,6 +90,7 @@ extension KingfisherWrapper where Base: KFCrossPlatformImage {
     var duration: TimeInterval { return base.duration }
     var size: CGSize { return base.size }
     
+    /// The image source reference of current image.
     public private(set) var imageSource: CGImageSource? {
         get { return getAssociatedObject(base, &imageSourceKey) }
         set { setRetainedAssociatedObject(base, &imageSourceKey, newValue) }