From b52bc34367cf7fa6927323c18afd32cd16a6211a Mon Sep 17 00:00:00 2001 From: onevcat Date: Sun, 3 Jan 2021 15:19:38 +0900 Subject: [PATCH] Conditional compile for old SDKs --- Kingfisher.podspec | 2 +- Sources/General/KFOptionsSetter.swift | 2 ++ Sources/SwiftUI/KFImageOptions.swift | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Kingfisher.podspec b/Kingfisher.podspec index d62a8f0dd..43fe89cd8 100644 --- a/Kingfisher.podspec +++ b/Kingfisher.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.license = { :type => "MIT", :file => "LICENSE" } s.authors = { "onevcat" => "onevcat@gmail.com" } - s.social_media_url = "https://twitter.com/onevcat" + s.social_media_url = "https://github.com/onevcat" s.swift_version = "5.0" s.swift_versions = ['4.0', '4.2', '5.0'] diff --git a/Sources/General/KFOptionsSetter.swift b/Sources/General/KFOptionsSetter.swift index 5151deafa..12d52efd4 100644 --- a/Sources/General/KFOptionsSetter.swift +++ b/Sources/General/KFOptionsSetter.swift @@ -41,6 +41,7 @@ extension KF.Builder: KFOptionSetter { 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 { @@ -54,6 +55,7 @@ extension KFImage: KFOptionSetter { public var delegateObserver: AnyObject { binder } } +#endif // MARK: - Life cycles extension KFOptionSetter { diff --git a/Sources/SwiftUI/KFImageOptions.swift b/Sources/SwiftUI/KFImageOptions.swift index 52edfb804..16f2e3e1f 100644 --- a/Sources/SwiftUI/KFImageOptions.swift +++ b/Sources/SwiftUI/KFImageOptions.swift @@ -24,6 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +#if canImport(SwiftUI) && canImport(Combine) import SwiftUI // MARK: - KFImage creating. @@ -125,3 +126,4 @@ extension KFImage { return result } } +#endif