Explorar o código

Move conformance to better place

onevcat %!s(int64=4) %!d(string=hai) anos
pai
achega
e1e00d42d8
Modificáronse 2 ficheiros con 15 adicións e 30 borrados
  1. 0 30
      Sources/General/KFOptionsSetter.swift
  2. 15 0
      Sources/SwiftUI/KFImageProtocol.swift

+ 0 - 30
Sources/General/KFOptionsSetter.swift

@@ -41,36 +41,6 @@ extension KF.Builder: KFOptionSetter {
     public var delegateObserver: AnyObject { self }
     public var delegateObserver: AnyObject { self }
 }
 }
 
 
-#if canImport(SwiftUI) && canImport(Combine)
-@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
-extension KFImage: KFOptionSetter {
-    public var options: KingfisherParsedOptionsInfo {
-        get { context.binder.options }
-        nonmutating set { context.binder.options = newValue }
-    }
-
-    public var onFailureDelegate: Delegate<KingfisherError, Void> { context.binder.onFailureDelegate }
-    public var onSuccessDelegate: Delegate<RetrieveImageResult, Void> { context.binder.onSuccessDelegate }
-    public var onProgressDelegate: Delegate<(Int64, Int64), Void> { context.binder.onProgressDelegate }
-
-    public var delegateObserver: AnyObject { context.binder }
-}
-
-@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
-extension KFAnimatedImage: KFOptionSetter {
-    public var options: KingfisherParsedOptionsInfo {
-        get { context.binder.options }
-        nonmutating set { context.binder.options = newValue }
-    }
-
-    public var onFailureDelegate: Delegate<KingfisherError, Void> { context.binder.onFailureDelegate }
-    public var onSuccessDelegate: Delegate<RetrieveImageResult, Void> { context.binder.onSuccessDelegate }
-    public var onProgressDelegate: Delegate<(Int64, Int64), Void> { context.binder.onProgressDelegate }
-
-    public var delegateObserver: AnyObject { context.binder }
-}
-#endif
-
 // MARK: - Life cycles
 // MARK: - Life cycles
 extension KFOptionSetter {
 extension KFOptionSetter {
     /// Sets the progress block to current builder.
     /// Sets the progress block to current builder.

+ 15 - 0
Sources/SwiftUI/KFImageProtocol.swift

@@ -91,4 +91,19 @@ public protocol KFImageHoldingView: View {
     static func created(from image: KFCrossPlatformImage) -> Self
     static func created(from image: KFCrossPlatformImage) -> Self
 }
 }
 
 
+@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
+extension KFImageProtocol {
+    public var options: KingfisherParsedOptionsInfo {
+        get { context.binder.options }
+        nonmutating set { context.binder.options = newValue }
+    }
+
+    public var onFailureDelegate: Delegate<KingfisherError, Void> { context.binder.onFailureDelegate }
+    public var onSuccessDelegate: Delegate<RetrieveImageResult, Void> { context.binder.onSuccessDelegate }
+    public var onProgressDelegate: Delegate<(Int64, Int64), Void> { context.binder.onProgressDelegate }
+
+    public var delegateObserver: AnyObject { context.binder }
+}
+
+
 #endif
 #endif