ソースを参照

Conditional compile for old SDKs

onevcat 5 年 前
コミット
b52bc34367

+ 1 - 1
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']

+ 2 - 0
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 {

+ 2 - 0
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