Explorar o código

Merge branch 'xcode11' into swiftui-support

onevcat %!s(int64=6) %!d(string=hai) anos
pai
achega
6b3ae19bab

+ 2 - 2
Package.swift

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

+ 1 - 1
Sources/Extensions/NSButton+Kingfisher.swift

@@ -24,7 +24,7 @@
 //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //  THE SOFTWARE.
 
-#if os(macOS)
+#if canImport(AppKit) && !targetEnvironment(macCatalyst)
 
 import AppKit
 

+ 2 - 0
Sources/Extensions/UIButton+Kingfisher.swift

@@ -24,6 +24,7 @@
 //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //  THE SOFTWARE.
 
+#if canImport(UIKit)
 import UIKit
 
 extension KingfisherWrapper where Base: UIButton {
@@ -390,3 +391,4 @@ extension KingfisherWrapper where Base: UIButton {
         return nil
     }
 }
+#endif

+ 1 - 1
Sources/Extensions/WKInterfaceImage+Kingfisher.swift

@@ -24,7 +24,7 @@
 //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //  THE SOFTWARE.
 
-#if os(watchOS)
+#if canImport(WatchKit)
 
 import WatchKit
 

+ 1 - 1
Sources/General/Deprecated.swift

@@ -24,7 +24,7 @@
 //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //  THE SOFTWARE.
 
-#if canImport(AppKit) && !targetEnvironment(UIKitForMac)
+#if canImport(AppKit) && !targetEnvironment(macCatalyst)
 import AppKit
 #elseif canImport(UIKit)
 import UIKit

+ 1 - 1
Sources/Image/ImageDrawing.swift

@@ -26,7 +26,7 @@
 
 import Accelerate
 
-#if canImport(AppKit) && !targetEnvironment(UIKitForMac)
+#if canImport(AppKit) && !targetEnvironment(macCatalyst)
 import AppKit
 #endif
 #if canImport(UIKit)

+ 1 - 1
Sources/Image/ImageProcessor.swift

@@ -27,7 +27,7 @@
 import Foundation
 import CoreGraphics
 
-#if canImport(AppKit) && !targetEnvironment(UIKitForMac)
+#if canImport(AppKit) && !targetEnvironment(macCatalyst)
 import AppKit
 #endif
 

+ 1 - 1
Sources/Utility/ExtensionHelpers.swift

@@ -32,7 +32,7 @@ extension Float {
     }
 }
 
-#if canImport(AppKit) && !targetEnvironment(UIKitForMac)
+#if canImport(AppKit) && !targetEnvironment(macCatalyst)
 import AppKit
 extension NSBezierPath {
     convenience init(roundedRect rect: NSRect, topLeftRadius: CGFloat, topRightRadius: CGFloat,

+ 2 - 0
Sources/Views/AnimatedImageView.swift

@@ -31,6 +31,7 @@
 //  The name and characters used in the demo of this software are property of their
 //  respective owners.
 
+#if canImport(UIKit)
 import UIKit
 import ImageIO
 
@@ -568,3 +569,4 @@ extension Array {
         return indices ~= index ? self[index] : nil
     }
 }
+#endif

+ 3 - 1
Sources/Views/Indicator.swift

@@ -24,7 +24,7 @@
 //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //  THE SOFTWARE.
 
-#if canImport(AppKit) && !targetEnvironment(UIKitForMac)
+#if canImport(AppKit) && !targetEnvironment(macCatalyst)
 import AppKit
 public typealias IndicatorView = NSView
 #else
@@ -120,6 +120,8 @@ final class ActivityIndicator: Indicator {
         #else
             #if os(tvOS)
                 let indicatorStyle = UIActivityIndicatorView.Style.white
+            #elseif targetEnvironment(macCatalyst)
+                let indicatorStyle = UIActivityIndicatorView.Style.medium
             #else
                 let indicatorStyle = UIActivityIndicatorView.Style.gray
             #endif