@@ -11,7 +11,7 @@ import Foundation
1111#if os(OSX)
1212import AppKit
1313typealias Image = NSImage
14- #elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
14+ #elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || os(visionOS)
1515import UIKit
1616typealias 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