Skip to content
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

Support visionOS #855

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Support visionOS #855

wants to merge 1 commit into from

Conversation

mihai8804858
Copy link
Contributor

This PR adds support for visionOS by adding a bunch of os(visionOS) checks and #available(visionOS 1.0, *).

ViewImageConfig for Vision Pro was added:

public static let visionPro = ViewImageConfig(
  safeArea: .zero,
  size: .init(width: 2700, height: 1360),
  traits: .init()
)

And UITraitCollection for Vision Pro was added:

public static let visionPro = UITraitCollection(
  traitsFrom: [
    .init(userInterfaceIdiom: .vision),
    .init(horizontalSizeClass: .regular),
    .init(verticalSizeClass: .regular),
    .init(displayScale: 2.0),
    .init(userInterfaceStyle: .dark),
    .init(layoutDirection: .leftToRight),
    .init(forceTouchCapability: .unavailable),
    .init(preferredContentSizeCategory: .large),
    .init(accessibilityContrast: .normal),
    .init(userInterfaceLevel: .base),
 ]
)

To support visionOS I had to update Xcode version to 15.3, and update test devices to iPhone 15 Pro Max (17.4) and Apple TV 4K (17.4).

Copy link

@janviaroraa janviaroraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts need to be resolved.

@mihai8804858
Copy link
Contributor Author

Conflicts need to be resolved.

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants