Skip to content

Commit

Permalink
Build for xrOS (Vision Pro) (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgrapperon authored Jul 25, 2023
1 parent 6559cdd commit 9fa2e7e
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions Sources/DeviceDependency/UIDeviceDependency_iOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,33 @@ import XCTestDynamicOverlay
systemName: .init { UIDevice.current.systemName },
systemVersion: .init { UIDevice.current.systemVersion },
identifierForVendor: .init { UIDevice.current.identifierForVendor },
orientation: .init { UIDevice.current.orientation },
orientation: .init {
#if swift(>=5.9) && os(xrOS)
return UIDeviceOrientation.unknown
#else
UIDevice.current.orientation
#endif
},
isGeneratingDeviceOrientationNotifications: .init {
UIDevice.current.isGeneratingDeviceOrientationNotifications
#if swift(>=5.9) && os(xrOS)
return false
#else
UIDevice.current.isGeneratingDeviceOrientationNotifications
#endif
},
beginGeneratingDeviceOrientationNotifications: .init {
UIDevice.current.beginGeneratingDeviceOrientationNotifications()
#if swift(>=5.9) && os(xrOS)
return
#else
UIDevice.current.beginGeneratingDeviceOrientationNotifications()
#endif
},
endGeneratingDeviceOrientationNotifications: .init {
UIDevice.current.endGeneratingDeviceOrientationNotifications()
#if swift(>=5.9) && os(xrOS)
return
#else
UIDevice.current.endGeneratingDeviceOrientationNotifications()
#endif
},
isBatteryMonitoringEnabled: .init(
.init {
Expand All @@ -185,7 +203,11 @@ import XCTestDynamicOverlay
isMultitaskingSupported: .init { UIDevice.current.isMultitaskingSupported },
userInterfaceIdiom: .init { UIDevice.current.userInterfaceIdiom },
playInputClick: .init {
UIDevice.current.playInputClick()
#if swift(>=5.9) && os(xrOS)
return
#else
UIDevice.current.playInputClick()
#endif
}
)
)
Expand Down

0 comments on commit 9fa2e7e

Please sign in to comment.