File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 1- // swift-tools-version:4.2
1+ // swift-tools-version:5.1
22
33import PackageDescription
44
Original file line number Diff line number Diff line change 1+ #if canImport(AppKit)
12import AppKit
3+ #endif
4+
5+ #if os(OSX)
26
37/// Helper UIImage extension.
48extension NSImage {
@@ -34,3 +38,5 @@ extension NSImage {
3438 . representation ( using: imageFileType, properties: [ : ] )
3539 }
3640}
41+
42+ #endif
Original file line number Diff line number Diff line change 1+ #if canImport(UIKit)
12import UIKit
3+ #endif
4+
5+ #if os(iOS) || os(watchOS) || os(tvOS)
26
37/// Helper UIImage extension.
48extension UIImage {
@@ -22,14 +26,9 @@ extension UIImage {
2226
2327 /// Convert to data
2428 func cache_toData( ) -> Data ? {
25- #if swift(>=4.2)
2629 return hasAlpha
2730 ? pngData ( )
2831 : jpegData ( compressionQuality: 1.0 )
29- #else
30- return hasAlpha
31- ? UIImagePNGRepresentation ( self )
32- : UIImageJPEGRepresentation ( self , 1.0 )
33- #endif
3432 }
3533}
34+ #endif
You can’t perform that action at this time.
0 commit comments