Selaa lähdekoodia

Fix CGImage resizing extension build error in macOS

xspyhack 7 vuotta sitten
vanhempi
commit
64d715976f
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      Sources/Image/ImageDrawing.swift

+ 2 - 0
Sources/Image/ImageDrawing.swift

@@ -539,6 +539,7 @@ extension KingfisherWrapper where Base: CGImage {
     ///   - targetSize: The target size in point.
     ///   - contentMode: Content mode of output image should be.
     /// - Returns: A CGImage with new size.
+    #if os(iOS) || os(tvOS)
     public func resize(to size: CGSize, for contentMode: UIView.ContentMode) -> CGImage {
         switch contentMode {
         case .scaleAspectFit:
@@ -549,6 +550,7 @@ extension KingfisherWrapper where Base: CGImage {
             return resize(to: size)
         }
     }
+    #endif
 
     // MARK: - Resize
     /// Resizes `base` CGImage to a CGImage with new size.