Swift Unwrap Live 2024 Notes

This is my notes from a full day workshop from Jan 27th, 2024 about Vision Pro. I took hand written notes during the entire thing and ended up with over 10 pages of hand written note along with some really nice ideas for UI going forward.

The keyboard shortcut to open the home view is `Shift` + CMD – H

The default window size is 1280 points by 720 points. Default rendering is 1360 points per meter.

There are two font sizes that are only available on VisionOS, extraLargeTitle and extraLargeTitle2.

Rendering in the simulator of fonts will feel smaller than they actually are in the device.

If you want to resize the window, you will do so in the lower right corner. If you want to move the window, you can do so with the bar at the bottom of the window.

You should use materials instead of straight up colors for differences, these are some of the example materials: regular, thin, thick.

You could also use the secondary, tertiary, quaternary, and quintenary versions that are available on Swift colors.

In the simulator if you want to move back and forth you need to hold shift and use the mouse.

You can also use PS5 controller to navigate in the simulator.

You should avoid having fast motion in the application.

You can also use keyboard and mouse to control the Vision Pro device.

When using the device you will have to learn to trust your eyes.

Don’t use onTap. Unless you are doing it intentionally to hide a feature. If you are going to, make sure you add a hover effect.

You can also disable the hover effect.

On device you can’t track the users eyes. This means you can’t use on hover. If you hook up a mouse it will work for on hover for that. On continuous hover also won’t do anything.

You can put button style plain on it.

It seems like SpriteKit is going to be obsoleted.

You can rotate in the simulator by right click and drag.

A good place to start is Apple’s “Happy Beam” example.

ARKit uses a lot of SIMD for vector stuff.

Simulator move with arrows.

You can create move Windows by using a Window Group and open window.

You should avoid using additional windows on iPad or iPhone. You should use as many as you wish on Mac and Vision Pro. You can do this by using compiler directives.

You won’t have direct camera access on Vision Pro device.

To make an icon for Vision Pro it requires 3 layers.

One of the new layout systems, they added is called Ornament, These allow you to extend information off of the main display to allow your users to focus on what they need.

You have two options for adding this, you can use the Toolbar Item method; which is limited to the bottom middle. Or you can use the ornament modifier to set it up.

For any views, including the ornament, you want to use the glass background effect.

You should keep your size of the ornament to the size of the window, like if its on the right side, have it stay smaller then the window height.

It is better to use a Tab View instead of Navigation Split View.

You may want to use content alignment on the ornaments.

A good use of ornaments is for filtering. If you want to use a sidebar, you could do this inside of an ornament with a VStack.

Another way to use the Toolbar Item group to contain multiple items.

Volumetric depth messes with the controls of the window.

Volumetric windows are back align.

You can set a default size, width, height, depth, and in measurement.

Views now have a frame depth modifier.

You can show debug info by clicking on the cube, and clicking on visualization bounds.

GeometryReader3d exists.

Reality View is really nice. Has 3 closures, initial render, update, and attachments. You can’t do custom lighting in Reality Kit for Vision.

MeshResource sizing is in meters.

Unlit Material color, and apply post process tone map.

Input Target component allows you to set if an entity will accept input, indirect, and direct.

Generate collision shapes, recursive if you want its children to also have colliders, static if you don’t move it dynamically in the scene.

You can do a custom CollisionComponent.

Camera button in the simulator bottom right resets positions.

Position is relative to parent. Location3d is SwiftUI positioning.

Rotate Gesture 3D exists.

You can apply a video to a texture.

Two apps that exist for 3d stuff, Reality Composer Pro and Reality Converter

If you want initial volumetric you have to change something in the plist or you will get a crash.

You can detect your fingertips in full immersion, but not in any other mode.

Center point of the immersive mode is the feet of the user.