-
-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add visionOS support #706
Comments
There are two build errors for visionOS: This one in Graphics.swift and another in ImageDecoders+Video.swift As a temporary solution you can open those files in Visual Studio Code and edit them (you will need to select overwrite when saving). To be clear, this is only a temporary solution and the scale value is just a guess, but it should allow it to compile. struct Screen {
#if os(xrOS)
/// 2 is just a guess, do not depend on it.
static var scale: CGFloat { 2 }
#elseif os(iOS) || os(tvOS)
/// Returns the current screen scale.
static var scale: CGFloat { UIScreen.main.scale }
#elseif os(watchOS)
/// Returns the current screen scale.
static var scale: CGFloat { WKInterfaceDevice.current().screenScale }
#elseif os(macOS)
/// Always returns 1.
static var scale: CGFloat { 1 }
#endif
} (UIScreen is not available in xrOS) private func makePreview(for data: Data) -> PlatformImage? {
#if os(xrOS)
return nil
#else
let asset = AVDataAsset(data: data)
let generator = AVAssetImageGenerator(asset: asset)
guard let cgImage = try? generator.copyCGImage(at: CMTime(value: 0, timescale: 1), actualTime: nil) else {
return nil
}
return PlatformImage(cgImage: cgImage)
#endif
} (copyCGImage is not available in xrOS) |
They might even change it to |
Do you know if SPM is supported? I can't get the package manifest to compile after adding |
Preliminary xrOS support is now available in |
Just putting it out there that the prompt attention you are giving this issue encouraged me to become a sponsor! Keep up the great work :) Looking forward to using Nuke in my visionOS app soon. |
I appreciate it, @drmarkpowell. It is in the works. I already have the latest Xcode beta and was planning to push the new pre-release version soon. |
Version 12.2 (Beta 2) fixes the new compilation errors in Xcode 15 Beta 6. The plan for the future version is to remove as many of the I'm yet to figure out how to add SPM support, especially in a way that won't break Xcode 14 compatibility. Any information on that is welcome. |
The text was updated successfully, but these errors were encountered: