Browse Source

Make Kingfisher Xcode 11 Swift Package Manager compatible

Bei Li 6 years ago
parent
commit
179ddb4142

+ 2 - 2
Package.swift

@@ -1,9 +1,9 @@
-// swift-tools-version:4.2
+// swift-tools-version:5.0
 import PackageDescription
 
 let package = Package(
     name: "Kingfisher",
-    // platforms: [.iOS("10.0"), .macOS("10.12"), tvOS("10.0"), .watchOS("3.0")],
+    platforms: [.iOS("10.0"), .macOS("10.12"), .tvOS("10.0"), .watchOS("3.0")],
     products: [
         .library(name: "Kingfisher", targets: ["Kingfisher"])
     ],

+ 3 - 0
Sources/Extensions/NSButton+Kingfisher.swift

@@ -24,6 +24,7 @@
 //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //  THE SOFTWARE.
 
+#if os(macOS)
 
 import AppKit
 
@@ -348,3 +349,5 @@ extension KingfisherWrapper where Base: NSButton {
         set { }
     }
 }
+
+#endif

+ 4 - 0
Sources/Extensions/WKInterfaceImage+Kingfisher.swift

@@ -24,6 +24,8 @@
 //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //  THE SOFTWARE.
 
+#if os(watchOS)
+
 import WatchKit
 
 extension KingfisherWrapper where Base: WKInterfaceImage {
@@ -198,3 +200,5 @@ extension KingfisherWrapper where Base: WKInterfaceImage {
         set { }
     }
 }
+
+#endif