@@ -11,7 +11,7 @@ import Foundation
11
11
#if os(OSX)
12
12
import AppKit
13
13
typealias Image = NSImage
14
- #elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
14
+ #elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || os(visionOS)
15
15
import UIKit
16
16
typealias Image = UIImage
17
17
#endif
@@ -214,7 +214,7 @@ struct Device: Codable {
214
214
let macName = Host . current ( ) . name ?? " Unknown Mac Devices "
215
215
name = macName
216
216
model = " \( macName) \( ProcessInfo . processInfo. operatingSystemVersionString) "
217
- #elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
217
+ #elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || os(visionOS)
218
218
let device = UIDevice . current
219
219
name = device. name
220
220
model = " \( device. name) ( \( device. systemName) \( device. systemVersion) ) "
@@ -410,7 +410,7 @@ extension Image {
410
410
return nil
411
411
}
412
412
return Image ( named: iconName)
413
- #elseif os(iOS) || os(tvOS)
413
+ #elseif os(iOS) || os(tvOS) || os(visionOS)
414
414
guard let iconsDictionary = Bundle . main. infoDictionary ? [ " CFBundleIcons " ] as? [ String : Any ] ,
415
415
let primaryIconsDictionary = iconsDictionary [ " CFBundlePrimaryIcon " ] as? [ String : Any ] ,
416
416
let iconFiles = primaryIconsDictionary [ " CFBundleIconFiles " ] as? [ String ] ,
@@ -426,7 +426,7 @@ extension Image {
426
426
// Resize, we don't need 1024px size
427
427
newRep. size = CGSize ( width: 64 , height: 64 )
428
428
return newRep. representation ( using: . png, properties: [ : ] )
429
- #elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS)
429
+ #elseif os(iOS) || targetEnvironment(macCatalyst) || os(tvOS) || os(visionOS)
430
430
// It's already by 64px
431
431
return self . pngData ( )
432
432
#endif
0 commit comments