Kaynağa Gözat

Fix all documentation warnings for Xcode 16

onevcat 1 yıl önce
ebeveyn
işleme
5407b1163a

+ 8 - 5
Sources/Cache/DiskStorage.swift

@@ -137,10 +137,11 @@ public enum DiskStorage {
         ///
         /// - Parameters:
         ///   - value: The value to be stored.
-        ///   - key: The key to which the `value` will be stored. If there is already a value under the key,
-        ///   the old value will be overwritten by the new `value`.
+        ///   - key: The key to which the `value` will be stored. If there is already a value under the key, the old
+        ///          value will be overwritten by the new `value`.
         ///   - expiration: The expiration policy used by this storage action.
         ///   - writeOptions: Data writing options used for the new files.
+        ///   - forcedExtension: The file extension, if exists.
         /// - Throws: An error during converting the value to a data format or during writing it to disk.
         public func store(
             value: T,
@@ -214,6 +215,7 @@ public enum DiskStorage {
         /// Retrieves a value from the storage.
         /// - Parameters:
         ///   - key: The cache key of the value.
+        ///   - forcedExtension: The file extension, if exists.
         ///   - extendingExpiration: The expiration policy used by this retrieval action.
         /// - Throws: An error during converting the data to a value or during the operation of disk files.
         /// - Returns: The value under `key` if it is valid and found in the storage; otherwise, `nil`.
@@ -291,7 +293,8 @@ public enum DiskStorage {
         /// - Returns: `true` if there is valid data under the key and file extension; otherwise, `false`.
         ///
         /// > This method does not actually load the data from disk, so it is faster than directly loading the cached
-        /// value by checking the nullability of the ``DiskStorage/Backend/value(forKey:extendingExpiration:)`` method.
+        /// value by checking the nullability of the
+        /// ``DiskStorage/Backend/value(forKey:forcedExtension:extendingExpiration:)`` method.
         public func isCached(forKey key: String, forcedExtension: String? = nil) -> Bool {
             return isCached(forKey: key, referenceDate: Date(), forcedExtension: forcedExtension)
         }
@@ -306,8 +309,8 @@ public enum DiskStorage {
         /// - Returns: `true` if there is valid data under the key; otherwise, `false`.
         ///
         /// If you pass `Date()` as the `referenceDate`, this method is identical to
-        /// ``DiskStorage/Backend/isCached(forKey:)``. Use the `referenceDate` to determine whether the cache is still
-        /// valid for a future date.
+        /// ``DiskStorage/Backend/isCached(forKey:forcedExtension:)``. Use the `referenceDate` to determine whether the
+        /// cache is still valid for a future date.
         public func isCached(forKey key: String, referenceDate: Date, forcedExtension: String? = nil) -> Bool {
             do {
                 let result = try value(

+ 6 - 4
Sources/Cache/ImageCache.swift

@@ -667,7 +667,7 @@ open class ImageCache: @unchecked Sendable {
     ///   as a result. Otherwise, a ``KingfisherError`` result with detailed failure reason will be sent.
     ///
     /// > This method is marked as `open` for compatibility purposes only. Do not override this method. Instead,
-    /// override the version ``ImageCache/retrieveImage(forKey:options:callbackQueue:completionHandler:)-1m1bb`` that 
+    /// override the version ``ImageCache/retrieveImageInDiskCache(forKey:options:callbackQueue:completionHandler:)``
     /// accepts a ``KingfisherParsedOptionsInfo`` value.
     open func retrieveImage(
         forKey key: String,
@@ -938,7 +938,7 @@ open class ImageCache: @unchecked Sendable {
     ///
     /// > The return value does not contain information about the kind of storage the cache matches from.
     /// > To obtain information about the cache type according to ``CacheType``, use
-    ///  ``ImageCache/imageCachedType(forKey:processorIdentifier:)`` instead.
+    ///  ``ImageCache/imageCachedType(forKey:processorIdentifier:forcedExtension:)`` instead.
     public func isCached(
         forKey key: String,
         processorIdentifier identifier: String = DefaultImageProcessor.default.identifier,
@@ -1009,7 +1009,7 @@ open class ImageCache: @unchecked Sendable {
     /// > This method does not guarantee that there is an image already cached in the returned path. It simply provides
     /// > the path where the image should be if it exists in the disk storage.
     /// >
-    /// > You could use the ``ImageCache/isCached(forKey:processorIdentifier:)`` method to check whether the image is
+    /// > You could use the ``ImageCache/isCached(forKey:processorIdentifier:forcedExtension:)`` method to check whether the image is
     /// cached under that key on disk if necessary.
     open func cachePath(
         forKey key: String,
@@ -1083,6 +1083,7 @@ open class ImageCache: @unchecked Sendable {
     ///   - key: The key used for caching the image.
     ///   - identifier: The identifier of the processor being used for caching. If you are using a processor for the
     ///   image, pass the identifier of the processor to this parameter.
+    ///   - forcedExtension: The file extension, if exists.
     ///   - serializer: The ``CacheSerializer`` used to convert the `image` and `original` to the data that will be
     ///   stored to disk. By default, the ``DefaultCacheSerializer/default`` will be used.
     ///   - toDisk: Whether this image should be cached to disk or not. If `false`, the image is only cached in memory.
@@ -1138,6 +1139,7 @@ open class ImageCache: @unchecked Sendable {
     ///   - key: The key used for caching the image.
     ///   - identifier: The identifier of the processor being used for caching. If you are using a processor for the
     ///   image, pass the identifier of the processor to this parameter.
+    ///   - forcedExtension: The file extension, if exists.
     ///   - fromMemory: Whether this image should be removed from memory storage or not. If `false`, the image won't be
     ///   removed from the memory storage. The default is `true`.
     ///   - fromDisk: Whether this image should be removed from the disk storage or not. If `false`, the image won't be
@@ -1196,7 +1198,7 @@ open class ImageCache: @unchecked Sendable {
     /// - Throws: An error of type ``KingfisherError``, if any error happens inside Kingfisher framework.
     ///
     /// > This method is marked as `open` for compatibility purposes only. Do not override this method. Instead,
-    /// override the version ``ImageCache/retrieveImage(forKey:options:callbackQueue:completionHandler:)-1m1bb`` that
+    /// override the version ``ImageCache/retrieveImage(forKey:options:callbackQueue:completionHandler:)-1jjo3`` that
     /// accepts a ``KingfisherParsedOptionsInfo`` value.
     open func retrieveImage(
         forKey key: String,

+ 2 - 2
Sources/Documentation.docc/CommonTasks/CommonTasks_Downloader.md

@@ -65,8 +65,8 @@ class AsyncModifier: AsyncImageDownloadRequestModifier {
 ```
 
 Similarly, use the ``KingfisherOptionsInfoItem/requestModifier(_:)`` to apply this modifier. In such scenarios, the
-``KingfisherWrapper/setImage(with:placeholder:options:progressBlock:completionHandler:)-2uid3`` or
-``ImageDownloader/downloadImage(with:options:completionHandler:)-5x6sa`` method will no longer return a ``DownloadTask``
+``KingfisherWrapper/setImage(with:placeholder:options:progressBlock:completionHandler:)-8lmr3`` or
+``ImageDownloader/downloadImage(with:options:completionHandler:)-2ztyq`` method will no longer return a ``DownloadTask``
 directly, as the download task isn't initiated instantly. To reference the task, monitor the
 ``AsyncImageDownloadRequestModifier/onDownloadTaskStarted`` callback.
 

+ 1 - 1
Sources/Documentation.docc/CommonTasks/CommonTasks_Processor.md

@@ -107,7 +107,7 @@ struct MyProcessor: ImageProcessor {
 }
 ```
 
-Then pass it to the ``KingfisherWrapper/setImage(with:placeholder:options:completionHandler:)-3ft7a`` methods:
+Then pass it to the ``KingfisherWrapper/setImage(with:placeholder:options:completionHandler:)-9h820`` methods:
 
 ```swift
 let processor = MyProcessor(someValue: 10)

+ 1 - 1
Sources/Documentation.docc/CommonTasks/CommonTasks_Serializer.md

@@ -55,7 +55,7 @@ struct MyCacheSerializer: CacheSerializer {
 }
 ```
 
-Then pass it to the ``KingfisherWrapper/setImage(with:placeholder:options:completionHandler:)-3ft7a`` methods:
+Then pass it to the ``KingfisherWrapper/setImage(with:placeholder:options:completionHandler:)-9h820`` methods:
 
 ```swift
 let serializer = MyCacheSerializer()

+ 2 - 1
Sources/General/KF.swift

@@ -344,7 +344,8 @@ extension KF.Builder {
     #endif
 
     /// Sets a placeholder image which is used while retrieving the image.
-    /// - Parameter placeholder: An image to show while retrieving the image from its source.
+    /// - Parameters:
+    ///   - image: An image to show while retrieving the image from its source.
     /// - Returns: A ``KF/Builder`` with changes applied.
     public func placeholder(_ image: KFCrossPlatformImage?) -> Self {
         self.placeholder = image

+ 0 - 1
Sources/Networking/ImageDownloader+LivePhoto.swift

@@ -41,7 +41,6 @@ public struct LivePhotoResourceDownloadingResult: Sendable {
     /// Creates an `ImageDownloadResult` object.
     ///
     /// - Parameters:
-    ///   - image: The image of the download result.
     ///   - url: The URL from which the image was downloaded.
     ///   - originalData: The binary data of the image.
     public init(originalData: Data, url: URL? = nil) {

+ 4 - 14
Sources/Networking/ImageDownloaderDelegate.swift

@@ -57,30 +57,20 @@ public protocol ImageDownloaderDelegate: AnyObject {
         didFinishDownloadingImageForURL url: URL,
         with response: URLResponse?,
         error: (any Error)?)
-
+    
     /// Called when the ``ImageDownloader`` object successfully downloads image data with a specified task.
     ///
-    /// This is your last chance to verify or modify the downloaded data before Kingfisher attempts to perform 
+    /// This is your last chance to verify or modify the downloaded data before Kingfisher attempts to perform
     /// additional processing on the image data.
     ///
     /// - Parameters:
     ///   - downloader: The ``ImageDownloader`` object used for the downloading operation.
     ///   - data: The original downloaded data.
-    ///   - dataTask: The data task containing request and response information for the download.
-    ///
+    ///   - task: The data task containing request and response information for the download.
     /// - Returns: The data that Kingfisher should use to create an image. You need to provide valid data that is in
     /// one of the supported image file formats. Kingfisher will process this data and attempt to convert it into an
     /// image object.
-    ///
-    ///
-    /// This method can be used to preprocess raw image data before the creation of the `Image` instance (e.g.,
-    /// decrypting or verification). If `nil` is returned, the processing is interrupted and a
-    /// ``KingfisherError/ResponseErrorReason/dataModifyingFailed(task:)`` error will be raised. You can use this fact
-    /// to stop the image processing flow if you find that the data is corrupted or malformed.
-    ///
-    /// > If this method is implemented, the `URL` version of 
-    /// ``ImageDownloaderDelegate/imageDownloader(_:didDownload:for:)-5btcl`` will not be called anymore.
-    func imageDownloader(_ downloader: ImageDownloader, didDownload data: Data, with dataTask: SessionDataTask) -> Data?
+    func imageDownloader(_ downloader: ImageDownloader, didDownload data: Data, with task: SessionDataTask) -> Data?
   
     /// Called when the ``ImageDownloader`` object successfully downloads image data from a specified URL.
     ///

+ 1 - 1
Sources/Networking/RedirectHandler.swift

@@ -73,7 +73,7 @@ public struct AnyRedirectHandler: ImageDownloadRedirectHandler {
     
     /// Creates a value of ``ImageDownloadRedirectHandler`` that executes the `modify` block.
     ///
-    /// - Parameter modify: The block that modifies the request when a request modification task is triggered.
+    /// - Parameter handle: The block that modifies the request when a request modification task is triggered.
     public init(handle: @escaping @Sendable (SessionDataTask, HTTPURLResponse, URLRequest, @escaping (URLRequest?) -> Void) -> Void) {
         block = handle
     }