Przeglądaj źródła

Add sample for loading indicator

onevcat 7 lat temu
rodzic
commit
93133e3b15

+ 80 - 6
Demo/Demo/Kingfisher-Demo/Base.lproj/Main.storyboard

@@ -103,7 +103,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="pci-sI-9qT" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="1851" y="243"/>
+            <point key="canvasLocation" x="2654" y="-452"/>
         </scene>
         <!--Navigation Controller-->
         <scene sceneID="a89-ss-78Y">
@@ -278,6 +278,30 @@
                                             <segue destination="UXA-j3-Wgu" kind="show" id="7cS-7z-3m8"/>
                                         </connections>
                                     </tableViewCell>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="xxW-va-fvw">
+                                        <rect key="frame" x="0.0" y="264" width="414" height="44"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="xxW-va-fvw" id="JDa-HW-wqO">
+                                            <rect key="frame" x="0.0" y="0.0" width="414" height="43.666666666666664"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Indicator" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="T0i-Bw-xV2">
+                                                    <rect key="frame" x="20" y="11.333333333333336" width="67.333333333333329" height="21"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="T0i-Bw-xV2" firstAttribute="centerY" secondItem="JDa-HW-wqO" secondAttribute="centerY" id="XkL-Wh-0Bp"/>
+                                                <constraint firstItem="T0i-Bw-xV2" firstAttribute="leading" secondItem="JDa-HW-wqO" secondAttribute="leading" constant="20" symbolic="YES" id="Y4K-vN-KoD"/>
+                                                <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="T0i-Bw-xV2" secondAttribute="trailing" constant="20" symbolic="YES" id="px4-ph-9kV"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <segue destination="8Cn-0c-zQX" kind="show" id="CGY-eE-LKY"/>
+                                        </connections>
+                                    </tableViewCell>
                                 </cells>
                             </tableViewSection>
                         </sections>
@@ -340,7 +364,7 @@
                 </collectionViewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="UWY-iA-aq1" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="1851" y="951"/>
+            <point key="canvasLocation" x="3442" y="-452"/>
         </scene>
         <!--Processor Collection View Controller-->
         <scene sceneID="h0T-TL-iQv">
@@ -390,7 +414,7 @@
                 </collectionViewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="DAi-LU-A26" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="1851" y="1653"/>
+            <point key="canvasLocation" x="1851" y="316"/>
         </scene>
         <!--High Resolution Collection View Controller-->
         <scene sceneID="EfE-0M-2tp">
@@ -441,7 +465,7 @@
                 </collectionViewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="Edl-Vs-bWD" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="1851" y="2349"/>
+            <point key="canvasLocation" x="2654" y="315"/>
         </scene>
         <!--View Controller-->
         <scene sceneID="3Ke-rL-QF2">
@@ -503,7 +527,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="hAo-Ts-6oW" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="1851" y="3059"/>
+            <point key="canvasLocation" x="3441" y="315"/>
         </scene>
         <!--Detail Image View Controller-->
         <scene sceneID="wpT-qC-cq3">
@@ -571,7 +595,57 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="Jcl-EP-bcn" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="2655" y="2349"/>
+            <point key="canvasLocation" x="3042" y="645"/>
+        </scene>
+        <!--Indicator Collection View Controller-->
+        <scene sceneID="WgK-pr-9tS">
+            <objects>
+                <collectionViewController id="8Cn-0c-zQX" customClass="IndicatorCollectionViewController" customModule="Kingfisher_Demo" customModuleProvider="target" sceneMemberID="viewController">
+                    <collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" id="KHw-Ia-NZ0">
+                        <rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="QR6-EV-Mcm">
+                            <size key="itemSize" width="250" height="250"/>
+                            <size key="headerReferenceSize" width="0.0" height="0.0"/>
+                            <size key="footerReferenceSize" width="0.0" height="0.0"/>
+                            <inset key="sectionInset" minX="0.0" minY="10" maxX="0.0" maxY="10"/>
+                        </collectionViewFlowLayout>
+                        <cells>
+                            <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="IndicatorCell" id="oic-g0-0T7" customClass="ImageCollectionViewCell" customModule="Kingfisher_Demo" customModuleProvider="target">
+                                <rect key="frame" x="82" y="10" width="250" height="250"/>
+                                <autoresizingMask key="autoresizingMask"/>
+                                <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+                                    <rect key="frame" x="0.0" y="0.0" width="250" height="250"/>
+                                    <autoresizingMask key="autoresizingMask"/>
+                                    <subviews>
+                                        <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="AHa-W9-ydh">
+                                            <rect key="frame" x="0.0" y="0.0" width="250" height="250"/>
+                                        </imageView>
+                                    </subviews>
+                                </view>
+                                <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <constraints>
+                                    <constraint firstAttribute="trailing" secondItem="AHa-W9-ydh" secondAttribute="trailing" id="Aki-5h-QfA"/>
+                                    <constraint firstItem="AHa-W9-ydh" firstAttribute="top" secondItem="oic-g0-0T7" secondAttribute="top" id="DrB-e3-ans"/>
+                                    <constraint firstAttribute="bottom" secondItem="AHa-W9-ydh" secondAttribute="bottom" id="Uxz-bA-hUp"/>
+                                    <constraint firstItem="AHa-W9-ydh" firstAttribute="leading" secondItem="oic-g0-0T7" secondAttribute="leading" id="fdr-x5-S6s"/>
+                                </constraints>
+                                <connections>
+                                    <outlet property="cellImageView" destination="AHa-W9-ydh" id="bnE-ur-ydz"/>
+                                </connections>
+                            </collectionViewCell>
+                        </cells>
+                        <connections>
+                            <outlet property="dataSource" destination="8Cn-0c-zQX" id="tbc-LR-q5V"/>
+                            <outlet property="delegate" destination="8Cn-0c-zQX" id="jnN-LL-oxb"/>
+                        </connections>
+                    </collectionView>
+                    <navigationItem key="navigationItem" id="mbM-AR-OT6"/>
+                </collectionViewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="sV2-nB-Yrc" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="1851" y="1062"/>
         </scene>
     </scenes>
 </document>

+ 118 - 0
Demo/Demo/Kingfisher-Demo/ViewControllers/IndicatorCollectionViewController.swift

@@ -0,0 +1,118 @@
+//
+//  IndicatorCollectionViewController.swift
+//  Kingfisher
+//
+//  Created by onevcat on 2018/11/26.
+//
+//  Copyright (c) 2018 Wei Wang <onevcat@gmail.com>
+//
+//  Permission is hereby granted, free of charge, to any person obtaining a copy
+//  of this software and associated documentation files (the "Software"), to deal
+//  in the Software without restriction, including without limitation the rights
+//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+//  copies of the Software, and to permit persons to whom the Software is
+//  furnished to do so, subject to the following conditions:
+//
+//  The above copyright notice and this permission notice shall be included in
+//  all copies or substantial portions of the Software.
+//
+//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+//  THE SOFTWARE.
+
+import UIKit
+import Kingfisher
+
+private let reuseIdentifier = "IndicatorCell"
+let gifData: Data = {
+    let url = Bundle.main.url(forResource: "loader", withExtension: "gif")!
+    return try! Data(contentsOf: url)
+}()
+
+class IndicatorCollectionViewController: UICollectionViewController {
+
+    class MyIndicator: Indicator {
+        
+        var timer: Timer?
+        
+        func startAnimatingView() {
+            view.isHidden = false
+            timer = Timer.scheduledTimer(withTimeInterval: 0.3, repeats: true) { _ in
+                UIView.animate(withDuration: 0.2, animations: {
+                    if self.view.backgroundColor == .red {
+                        self.view.backgroundColor = .orange
+                    } else {
+                        self.view.backgroundColor = .red
+                    }
+                })
+            }
+        }
+        
+        func stopAnimatingView() {
+            view.isHidden = true
+            timer?.invalidate()
+        }
+        
+        var view: IndicatorView = {
+            let view = UIView()
+            view.heightAnchor.constraint(equalToConstant: 30).isActive = true
+            view.widthAnchor.constraint(equalToConstant: 30).isActive = true
+            
+            view.backgroundColor = .red
+            return view
+        }()
+    }
+    
+    let indicators: [String] = [
+        "None",
+        "UIActivityIndicatorView",
+        "GIF Image",
+        "Custom"
+    ]
+    var selectedIndicatorIndex: Int = 1 {
+        didSet {
+            collectionView.reloadData()
+        }
+    }
+    var selectedIndicatorType: IndicatorType {
+        switch selectedIndicatorIndex {
+        case 0: return .none
+        case 1: return .activity
+        case 2: return .image(imageData: gifData)
+        case 3: return .custom(indicator: MyIndicator())
+        default: fatalError()
+        }
+    }
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupOperationNavigationBar()
+    }
+
+    override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return ImageLoader.sampleImageURLs.count
+    }
+
+    override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) as! ImageCollectionViewCell
+        cell.cellImageView.kf.indicatorType = selectedIndicatorType
+        cell.cellImageView.kf.setImage(
+            with: ImageLoader.sampleImageURLs[indexPath.row],
+            options: [.memoryCacheExpiration(.expired), .diskCacheExpiration(.expired)])
+        return cell
+    }
+    
+    override func alertPopup(_ sender: Any) -> UIAlertController {
+        let alert = super.alertPopup(sender)
+        for item in indicators.enumerated() {
+            alert.addAction(UIAlertAction.init(title: item.element, style: .default) { _ in
+                self.selectedIndicatorIndex = item.offset
+            })
+        }
+        return alert
+    }
+}

+ 4 - 0
Demo/Kingfisher-Demo.xcodeproj/project.pbxproj

@@ -50,6 +50,7 @@
 		D1F06F3321AA4292000B1C38 /* DetailImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F06F3221AA4292000B1C38 /* DetailImageViewController.swift */; };
 		D1F06F3521AA5938000B1C38 /* ImageCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12E0C911C47F91800AC98AD /* ImageCollectionViewCell.swift */; };
 		D1F06F3721AAEACF000B1C38 /* GIFViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F06F3621AAEACF000B1C38 /* GIFViewController.swift */; };
+		D1F06F3921AAF1EE000B1C38 /* IndicatorCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F06F3821AAF1EE000B1C38 /* IndicatorCollectionViewController.swift */; };
 		D1FAB06F21A853E600908910 /* HighResolutionCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1FAB06E21A853E600908910 /* HighResolutionCollectionViewController.swift */; };
 /* End PBXBuildFile section */
 
@@ -171,6 +172,7 @@
 		D1ED2D0B1AD2CFA600CFC3EB /* Kingfisher-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Kingfisher-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; };
 		D1F06F3221AA4292000B1C38 /* DetailImageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailImageViewController.swift; sourceTree = "<group>"; };
 		D1F06F3621AAEACF000B1C38 /* GIFViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GIFViewController.swift; sourceTree = "<group>"; };
+		D1F06F3821AAF1EE000B1C38 /* IndicatorCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndicatorCollectionViewController.swift; sourceTree = "<group>"; };
 		D1FAB06E21A853E600908910 /* HighResolutionCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighResolutionCollectionViewController.swift; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
@@ -325,6 +327,7 @@
 				D1FAB06E21A853E600908910 /* HighResolutionCollectionViewController.swift */,
 				D1F06F3221AA4292000B1C38 /* DetailImageViewController.swift */,
 				D1F06F3621AAEACF000B1C38 /* GIFViewController.swift */,
+				D1F06F3821AAF1EE000B1C38 /* IndicatorCollectionViewController.swift */,
 			);
 			path = ViewControllers;
 			sourceTree = "<group>";
@@ -606,6 +609,7 @@
 				D12E0C9B1C47F91800AC98AD /* NormalLoadingViewController.swift in Sources */,
 				D1CE1BD021A1AFA300419000 /* TransitionViewController.swift in Sources */,
 				D10AC99821A300C9005F057C /* ProcessorCollectionViewController.swift in Sources */,
+				D1F06F3921AAF1EE000B1C38 /* IndicatorCollectionViewController.swift in Sources */,
 				D12E0C981C47F91800AC98AD /* ImageCollectionViewCell.swift in Sources */,
 				D1A1CCA721A18A3200263AD8 /* UIViewController+KingfisherOperation.swift in Sources */,
 				D1FAB06F21A853E600908910 /* HighResolutionCollectionViewController.swift in Sources */,

+ 1 - 1
Sources/Extensions/WKInterfaceImage+Kingfisher.swift

@@ -44,7 +44,7 @@ extension KingfisherWrapper where Base: WKInterfaceImage {
             return nil
         }
         
-        let options = KingfisherManager.shared.defaultOptions + (options ?? .empty)
+        let options = KingfisherParsedOptionsInfo(KingfisherManager.shared.defaultOptions + (options ?? .empty))
         if !options.keepCurrentImageWhileLoading {
             base.setImage(placeholder)
         }

+ 25 - 25
Sources/General/Deprecated.swift

@@ -448,28 +448,28 @@ public let KingfisherErrorStatusCodeKey = "statusCode"
 public extension Collection where Iterator.Element == KingfisherOptionsInfoItem {
     /// The target `ImageCache` which is used.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `targetCache` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `targetCache` instead.")
     public var targetCache: ImageCache? {
         return KingfisherParsedOptionsInfo(Array(self)).targetCache
     }
 
     /// The original `ImageCache` which is used.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `originalCache` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `originalCache` instead.")
     public var originalCache: ImageCache? {
         return KingfisherParsedOptionsInfo(Array(self)).originalCache
     }
 
     /// The `ImageDownloader` which is specified.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `downloader` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `downloader` instead.")
     public var downloader: ImageDownloader? {
         return KingfisherParsedOptionsInfo(Array(self)).downloader
     }
 
     /// Member for animation transition when using UIImageView.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `transition` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `transition` instead.")
     public var transition: ImageTransition {
         return KingfisherParsedOptionsInfo(Array(self)).transition
     }
@@ -477,63 +477,63 @@ public extension Collection where Iterator.Element == KingfisherOptionsInfoItem
     /// A `Float` value set as the priority of image download task. The value for it should be
     /// between 0.0~1.0.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `downloadPriority` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `downloadPriority` instead.")
     public var downloadPriority: Float {
         return KingfisherParsedOptionsInfo(Array(self)).downloadPriority
     }
 
     /// Whether an image will be always downloaded again or not.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `forceRefresh` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `forceRefresh` instead.")
     public var forceRefresh: Bool {
         return KingfisherParsedOptionsInfo(Array(self)).forceRefresh
     }
 
     /// Whether an image should be got only from memory cache or download.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `fromMemoryCacheOrRefresh` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `fromMemoryCacheOrRefresh` instead.")
     public var fromMemoryCacheOrRefresh: Bool {
         return KingfisherParsedOptionsInfo(Array(self)).fromMemoryCacheOrRefresh
     }
 
     /// Whether the transition should always happen or not.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `forceTransition` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `forceTransition` instead.")
     public var forceTransition: Bool {
         return KingfisherParsedOptionsInfo(Array(self)).forceTransition
     }
 
     /// Whether cache the image only in memory or not.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `cacheMemoryOnly` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `cacheMemoryOnly` instead.")
     public var cacheMemoryOnly: Bool {
         return KingfisherParsedOptionsInfo(Array(self)).cacheMemoryOnly
     }
 
     /// Whether the caching operation will be waited or not.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `waitForCache` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `waitForCache` instead.")
     public var waitForCache: Bool {
         return KingfisherParsedOptionsInfo(Array(self)).waitForCache
     }
 
     /// Whether only load the images from cache or not.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `onlyFromCache` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `onlyFromCache` instead.")
     public var onlyFromCache: Bool {
         return KingfisherParsedOptionsInfo(Array(self)).onlyFromCache
     }
 
     /// Whether the image should be decoded in background or not.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `backgroundDecode` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `backgroundDecode` instead.")
     public var backgroundDecode: Bool {
         return KingfisherParsedOptionsInfo(Array(self)).backgroundDecode
     }
 
     /// Whether the image data should be all loaded at once if it is an animated image.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `preloadAllAnimationData` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `preloadAllAnimationData` instead.")
     public var preloadAllAnimationData: Bool {
         return KingfisherParsedOptionsInfo(Array(self)).preloadAllAnimationData
     }
@@ -541,42 +541,42 @@ public extension Collection where Iterator.Element == KingfisherOptionsInfoItem
     /// The `CallbackQueue` on which completion handler should be invoked.
     /// If not set in the options, `.mainCurrentOrAsync` will be used.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `callbackQueue` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `callbackQueue` instead.")
     public var callbackQueue: CallbackQueue {
         return KingfisherParsedOptionsInfo(Array(self)).callbackQueue
     }
 
     /// The scale factor which should be used for the image.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `scaleFactor` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `scaleFactor` instead.")
     public var scaleFactor: CGFloat {
         return KingfisherParsedOptionsInfo(Array(self)).scaleFactor
     }
 
     /// The `ImageDownloadRequestModifier` will be used before sending a download request.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `requestModifier` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `requestModifier` instead.")
     public var modifier: ImageDownloadRequestModifier {
         return KingfisherParsedOptionsInfo(Array(self)).requestModifier
     }
 
     /// `ImageProcessor` for processing when the downloading finishes.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `processor` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `processor` instead.")
     public var processor: ImageProcessor {
         return KingfisherParsedOptionsInfo(Array(self)).processor
     }
 
     /// `ImageModifier` for modifying right before the image is displayed.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `imageModifier` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `imageModifier` instead.")
     public var imageModifier: ImageModifier {
         return KingfisherParsedOptionsInfo(Array(self)).imageModifier
     }
 
     /// `CacheSerializer` to convert image to data for storing in cache.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `cacheSerializer` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `cacheSerializer` instead.")
     public var cacheSerializer: CacheSerializer {
         return KingfisherParsedOptionsInfo(Array(self)).cacheSerializer
     }
@@ -584,42 +584,42 @@ public extension Collection where Iterator.Element == KingfisherOptionsInfoItem
     /// Keep the existing image while setting another image to an image view.
     /// Or the placeholder will be used while downloading.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `keepCurrentImageWhileLoading` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `keepCurrentImageWhileLoading` instead.")
     public var keepCurrentImageWhileLoading: Bool {
         return KingfisherParsedOptionsInfo(Array(self)).keepCurrentImageWhileLoading
     }
 
     /// Whether the options contains `.onlyLoadFirstFrame`.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `onlyLoadFirstFrame` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `onlyLoadFirstFrame` instead.")
     public var onlyLoadFirstFrame: Bool {
         return KingfisherParsedOptionsInfo(Array(self)).onlyLoadFirstFrame
     }
 
     /// Whether the options contains `.cacheOriginalImage`.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `cacheOriginalImage` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `cacheOriginalImage` instead.")
     public var cacheOriginalImage: Bool {
         return KingfisherParsedOptionsInfo(Array(self)).cacheOriginalImage
     }
 
     /// The image which should be used when download image request fails.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `onFailureImage` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `onFailureImage` instead.")
     public var onFailureImage: Optional<Image?> {
         return KingfisherParsedOptionsInfo(Array(self)).onFailureImage
     }
 
     /// Whether the `ImagePrefetcher` should load images to memory in an aggressive way or not.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `alsoPrefetchToMemory` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `alsoPrefetchToMemory` instead.")
     public var alsoPrefetchToMemory: Bool {
         return KingfisherParsedOptionsInfo(Array(self)).alsoPrefetchToMemory
     }
 
     /// Whether the disk storage file loading should happen in a synchronous behavior or not.
     @available(*, deprecated,
-    message: "Create a `KingfisherParsedOptionsInfo` from `self` and use `loadDiskFileSynchronously` instead.")
+    message: "Create a `KingfisherParsedOptionsInfo` from `KingfisherOptionsInfo` and use `loadDiskFileSynchronously` instead.")
     public var loadDiskFileSynchronously: Bool {
         return KingfisherParsedOptionsInfo(Array(self)).loadDiskFileSynchronously
     }