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 enables customers to preview giant renderings of visionOS app objects in 3D with enhanced decision. Through the use of Fast Look, customers can choose 3D objects in visionOS and enlarge them for a 3D preview.
To supply a Fast Look preview in your visionOS app, all you could do is present a URL.
There are two strategies for previewing 3D content material in Fast Look on visionOS: in-app fashion or windowed (much like how Fast Look works in macOS).
In-app fashion
With in-app fashion you may view 3D objects in a visionOS scene in-place, with out having to open a separate interface. In-app fashion offers fast and simple previews of 3D objects just by tapping on them.
Utilizing in-app fashion permits customers to control and preview objects instantly.
Windowed
In windowed Fast Look, 3D objects are displayed in a quantity, permitting you to view all out there 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 may cycle by way of all out there objects in a single house as a substitute of getting to pick every one, after which preview it.
PreviewApplication API
visionOS 2 offers a brand new PreviewApplication API using SwiftUI and concurrency to permit builders to incorporate Fast Look of their visionOS apps with just some 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 likewise import
the QuickLook
framework on the high 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
, cross 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 person 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 mechanically.
By passing an array of URLs within the .selectedURL
parameter as a substitute of a single URL, you may permit the person to preview a number of objects in a Assortment View Fast Look window.
You may also specify whether or not or to not show a preview modifying tab so the person could make edits to the merchandise being previewed by setting the editingMode:
parameter to .enabled
. You may also 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 offers Configurations. With Configurations, you may specify choices or variants of 3D objects for the person to select from. These can embrace measurement, shade, transparency, and so on.
You may also present texture choices for 3D objects in Fast Look, however have in mind all Fast Look previews ought to be capable of load rapidly so that you should not embrace any choices that take an excessive amount of time to render.
Through the use of Configurations, you may permit customers to customise 3D objects within the visionOS surroundings.
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 tips on how to present visionOS customers with high-resolution 3D previews of objects on Apple Imaginative and prescient Professional.