Skip to content

Commit

Permalink
Fixed visionOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
orchetect committed Dec 25, 2024
1 parent 250cd86 commit 99b755e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sources/OTCore/Extensions/Foundation/URL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ extension URL {

// platform-specific logic

#if os(macOS) || targetEnvironment(macCatalyst) || os(iOS)
#if os(macOS) || targetEnvironment(macCatalyst) || os(iOS) || os(visionOS)

if #available(macOS 10.8, iOS 11.0, *) {
// move file to trash
Expand Down
7 changes: 6 additions & 1 deletion Sources/OTCore/Global/Globals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,13 @@ extension Globals {
return Host.current().localizedName ?? ""
#elseif os(iOS) || os(tvOS)
return await UIDevice.current.name
#elseif os(watchOS)
return "Apple Watch"
#elseif os(visionOS)
return "Vision Pro"
#else
fatalError("Not implemented on this platform yet.")
assertionFailure("Not implemented on this platform yet.")
return "Device"
#endif
}
}
Expand Down
2 changes: 0 additions & 2 deletions Tests/OTCoreTests/Global/Globals Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ import OTCore

#expect(Globals.System.osVersion != "")

#if !os(watchOS)
#expect(await Globals.System.name != "")
#endif

#if os(macOS)
#expect(Globals.System.serialNumber != nil)
Expand Down

0 comments on commit 99b755e

Please sign in to comment.