Quellcode durchsuchen

complete documentation

Yang Chao vor 2 Jahren
Ursprung
Commit
86b4c21401
2 geänderte Dateien mit 8 neuen und 0 gelöschten Zeilen
  1. 7 0
      Sources/Image/GIFAnimatedImage.swift
  2. 1 0
      Sources/Image/Image.swift

+ 7 - 0
Sources/Image/GIFAnimatedImage.swift

@@ -127,9 +127,16 @@ public class GIFAnimatedImage {
 
 /// Represents a frame source for animated image
 public protocol ImageFrameSource {
+    /// Source data associated with this frame source.
     var data: Data? { get }
+    
+    /// Count of total frames in this frame source.
     var frameCount: Int { get }
+    
+    /// Retrieves the frame at a specific index. If the index is invalid, implementors should return `nil`.
     func frame(at index: Int) -> CGImage?
+    
+    /// Retrieves the duration at a specific index. If the index is invalid, implementors should return `0.0`.
     func duration(at index: Int) -> TimeInterval
 }
 

+ 1 - 0
Sources/Image/Image.swift

@@ -98,6 +98,7 @@ extension KingfisherWrapper where Base: KFCrossPlatformImage {
         }
     }
     
+    /// The custom frame source of current image.
     public private(set) var frameSource: ImageFrameSource? {
         get { return getAssociatedObject(base, &imageSourceKey) }
         set { setRetainedAssociatedObject(base, &imageSourceKey, newValue) }