Skip to content

Commit 4579425

Browse files
authored
feat: Add visionOS support (#136)
1 parent cfa7208 commit 4579425

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/Packages.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111
#if os(OSX)
1212
import AppKit
1313
typealias Image = NSImage
14-
#elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
14+
#elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || os(visionOS)
1515
import UIKit
1616
typealias Image = UIImage
1717
#endif
@@ -214,7 +214,7 @@ struct Device: Codable {
214214
let macName = Host.current().name ?? "Unknown Mac Devices"
215215
name = macName
216216
model = "\(macName) \(ProcessInfo.processInfo.operatingSystemVersionString)"
217-
#elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
217+
#elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || os(visionOS)
218218
let device = UIDevice.current
219219
name = device.name
220220
model = "\(device.name) (\(device.systemName) \(device.systemVersion))"
@@ -410,7 +410,7 @@ extension Image {
410410
return nil
411411
}
412412
return Image(named: iconName)
413-
#elseif os(iOS) || os(tvOS)
413+
#elseif os(iOS) || os(tvOS) || os(visionOS)
414414
guard let iconsDictionary = Bundle.main.infoDictionary?["CFBundleIcons"] as? [String: Any],
415415
let primaryIconsDictionary = iconsDictionary["CFBundlePrimaryIcon"] as? [String: Any],
416416
let iconFiles = primaryIconsDictionary["CFBundleIconFiles"] as? [String],
@@ -426,7 +426,7 @@ extension Image {
426426
// Resize, we don't need 1024px size
427427
newRep.size = CGSize(width: 64, height: 64)
428428
return newRep.representation(using: .png, properties: [:])
429-
#elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
429+
#elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || os(visionOS)
430430
// It's already by 64px
431431
return self.pngData()
432432
#endif

0 commit comments

Comments
 (0)