Skip to content

Commit f77ce0f

Browse files
committed
Protecting iOS imports
1 parent 5531d44 commit f77ce0f

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

SwiftDraw/Image.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import Foundation
3333

3434
#if canImport(CoreGraphics)
35+
import CoreGraphics
3536

3637
@objc(SVGImage)
3738
public final class Image: NSObject {

SwiftDraw/NSImage+Image.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
// 3. This notice may not be removed or altered from any source distribution.
3030
//
3131

32+
#if canImport(AppKit)
3233
import AppKit
3334
import CoreGraphics
3435

@@ -109,3 +110,5 @@ public extension Image {
109110
return bitmap.representation(using: .jpeg, properties: [NSBitmapImageRep.PropertyKey.compressionFactor: quality])
110111
}
111112
}
113+
114+
#endif

SwiftDraw/UIImage+Image.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
// 3. This notice may not be removed or altered from any source distribution.
3030
//
3131

32+
#if canImport(UIKit)
3233
import UIKit
3334

3435
public extension UIImage {
@@ -68,3 +69,5 @@ public extension Image {
6869
return rasterize(with: jpgSize).jpegData(compressionQuality: quality)
6970
}
7071
}
72+
73+
#endif

0 commit comments

Comments
 (0)