Explorar o código

Merge pull request #1300 from yonaskolb/fix_swiftUI_archive

Fix archiving
Wei Wang %!s(int64=6) %!d(string=hai) anos
pai
achega
d4b75b2b81
Modificáronse 2 ficheiros con 5 adicións e 2 borrados
  1. 2 1
      Sources/SwiftUI/ImageBinder.swift
  2. 3 1
      Sources/SwiftUI/KFImage.swift

+ 2 - 1
Sources/SwiftUI/ImageBinder.swift

@@ -24,9 +24,9 @@
 //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //  THE SOFTWARE.
 
+#if canImport(SwiftUI) && canImport(Combine)
 import Combine
 import SwiftUI
-
 #if !KingfisherCocoaPods
 import Kingfisher
 #endif
@@ -138,3 +138,4 @@ extension KFImage {
         }
     }
 }
+#endif

+ 3 - 1
Sources/SwiftUI/KFImage.swift

@@ -24,8 +24,9 @@
 //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //  THE SOFTWARE.
 
-import SwiftUI
+#if canImport(SwiftUI) && canImport(Combine)
 import Combine
+import SwiftUI
 #if !KingfisherCocoaPods
 import Kingfisher
 #endif
@@ -206,3 +207,4 @@ struct KFImage_Previews : PreviewProvider {
     }
 }
 #endif
+#endif