visit
Recently, Apple released the Vision Pro, and I was fortunate enough to become a proud owner. Since then, I've been deeply engaged in developing my application and exploring various apps and trends within the Vision Pro App Store.
I'm sure you've noticed that when viewing a video or photo, the background behind the window is darkened, in the settings it's called "auto-dimming". To get the same effect you need to use .preferredSurroundingsEffect(.systemDark)
on your view and then the space around the user will darken and your window will remain bright, this will help to keep the focus on the content.
When viewing a video or content, you want the user to have no distractions and create the effect of a window floating in the air, for this Apple has given us the ability to hide the bottom bar of the window that is used to move or close the current window. With .persistentSystemOverlays(.hidden)
you can hide this control bar on your window, it will disappear with the default animation and only appear when the user interacts with the window.
If you open the standard Apple TV application and turn on a movie, you will notice that the movie window has a reflection that changes with each frame, giving a more immersive effect. To get a glow effect around your video, you need to use VideoPlayerComponent
and enable isPassthroughTintingEnabled
, then the effect will be the same as in Apple TV or HBO Max. Here is what the documentation says:
This is to enable passthrough tinting during video playback that shows up around the video taking the average color of the frame and tinting the passthrough with that color to emphasize the video.
onAppear {
guard let windowScene = UIApplication.shared.connectedScenes.first as?UIWindowScene else { return }
windowScene.requestGeometryUpdate(.Vision(resizingRestrictions: UIWindowScene.ResizingRestrictions.none))
}
windowScene.requestGeometryUpdate(.Vision(size:, minimumSize:, maximumSize:, resizingRestrictions:))
If your application uses immersive space and you don’t want the user to see their hands, or you want to replace them with virtual hands, as is done in AmazeVR, then you need to use .upperLimbVisibility(.hidden)
I'm sure you've seen sidebars in VisionOS applications that look like TabBars
. Apple has introduced a new View
method for VisionOS that allows you to "expand" the window and add ornaments on either side of it.
.ornament(
visibility: .visible,
attachmentAnchor: .scene(.bottom),
contentAlignment: .center
) {
HStack {
Button("Play", systemImage: "play.fill") {
}
Button("Stop", systemImage: "stop.fill") {
}
}
.labelStyle(.iconOnly)
.padding(.all)
.glassBackgroundEffect()
}