Apple introduced some new Fast Look options for visionOS 2.0 at WWDC 2024. On this article we’ll take a look at new methods to make use of QuickLook in Apple Imaginative and prescient Professional.
Fast Look is a function of visionOS that permits customers to preview massive renderings of visionOS app objects in 3D with enhanced decision. By utilizing Fast Look, customers can choose 3D objects in visionOS and enlarge them for a 3D preview.
To offer a Fast Look preview in your visionOS app, all you should do is present a URL.
There are two strategies for previewing 3D content material in Fast Look on visionOS: in-app type or windowed (just like how Fast Look works in macOS).
In-app type
With in-app type you possibly can view 3D objects in a visionOS scene in-place, with out having to open a separate interface. In-app type supplies fast and straightforward previews of 3D objects just by tapping on them.
Utilizing in-app type permits customers to govern and preview objects immediately.
Windowed
In windowed Fast Look, 3D objects are displayed in a quantity, permitting you to view all accessible 3D objects in a single overlay window.
Windowed Fast Look is useful for viewing quite a few objects with ease and it is quicker since you possibly can cycle by means of all accessible objects in a single house as an alternative of getting to pick out every one, after which preview it.
PreviewApplication API
visionOS 2 supplies a brand new PreviewApplication API using SwiftUI and concurrency to permit builders to incorporate Fast Look of their visionOS apps with only a few strains of code.
Utilizing the PreviewApplication API, visionOS apps can present a Fast Look preview for a single object, or a gaggle of previews utilizing a Assortment View.
To make use of the PreviewApplication API you may have to create a brand new View
subclass in a Swift file in Xcode, and in addition import
the QuickLook
framework on the prime of your view subclass file.
Within the physique
of your View subclass, add a thumbnail view and an .onTapGesture
methodology.
Inside your .onTapGesture
methodology, first create a PreviewItem
, go within the URL(s) of your 3D object(s) then name the PreviewApplication.open
methodology, passing within the preview merchandise you created.
Utilizing this code, when the consumer faucets on a file, it opens in a brand new window within the visionOS workspace. If the file comprises video, the video begins taking part in robotically.
By passing an array of URLs within the .selectedURL
parameter as an alternative of a single URL, you possibly can enable the consumer to preview a number of objects in a Assortment View Fast Look window.
You can too specify whether or not or to not show a preview modifying tab so the consumer could make edits to the merchandise being previewed by setting the editingMode:
parameter to .enabled
. You can too change the present title of the merchandise being previewed.
There are different new Fast Look API adjustments in visionOS 2 together with Fast Look preview session occasions and others.
Configurations
Fast Look in visionOS 2 additionally supplies Configurations. With Configurations, you possibly can specify choices or variants of 3D objects for the consumer to select from. These can embody measurement, coloration, transparency, and so forth.
You can too present texture choices for 3D objects in Fast Look, however have in mind all Fast Look previews ought to have the ability to load rapidly so that you should not embody any choices that take an excessive amount of time to render.
By utilizing Configurations, you possibly can enable customers to customise 3D objects within the visionOS atmosphere.
Apple has a session What’s new in Fast Look for visionOS overlaying new options and adjustments in Fast Search for imaginative and prescient OS 2.0 from WWDC24.
There’s additionally a Fast Look 3D mannequin overview gallery which reveals learn how to present visionOS customers with high-resolution 3D previews of objects on Apple Imaginative and prescient Professional.