فهرست منبع

Fix watchOS build

onevcat 7 سال پیش
والد
کامیت
fe9f1b540f

+ 9 - 0
Sources/Extensions/ImageView+Kingfisher.swift

@@ -297,3 +297,12 @@ extension KingfisherClass where Base: ImageView {
 @objc extension ImageView {
     func shouldPreloadAllAnimation() -> Bool { return true }
 }
+
+extension KingfisherClass where Base: ImageView {
+    /// Gets the image URL binded to this image view.
+    @available(*, deprecated, message: "Use `taskIdentifier` instead.", renamed: "taskIdentifier")
+    public private(set) var webURL: URL? {
+        get { return taskIdentifier.flatMap { URL(string: $0) } }
+        set { taskIdentifier = newValue?.absoluteString }
+    }
+}

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

@@ -77,7 +77,7 @@ extension KingfisherClass where Base: WKInterfaceImage {
                 DispatchQueue.main.safeAsync {
                     guard resource.downloadURL == self.webURL else {
                         let error = KingfisherError.imageSettingError(
-                            reason: .notCurrentSource(result: result.value, error: result.error, resource: resource))
+                            reason: .notCurrentSource(result: result.value, error: result.error, source: .network(resource)))
                         completionHandler?(.failure(error))
                         return
                     }

+ 0 - 9
Sources/General/Deprecated.swift

@@ -449,12 +449,3 @@ public let KingfisherErrorDomain = "com.onevcat.Kingfisher.Error"
 @available(*, unavailable,
 message: "Use `.invalidHTTPStatusCode` or `isInvalidResponseStatusCode` of `KingfisherError` instead for the status code.")
 public let KingfisherErrorStatusCodeKey = "statusCode"
-
-extension KingfisherClass where Base: ImageView {
-    /// Gets the image URL binded to this image view.
-    @available(*, deprecated, message: "Use `taskIdentifier` instead.", renamed: "taskIdentifier")
-    public private(set) var webURL: URL? {
-        get { return taskIdentifier.flatMap { URL(string: $0) } }
-        set { taskIdentifier = newValue?.absoluteString }
-    }
-}