Previews
Generated on 9/25/2024
1 search
At WWDC 2024, several sessions introduced new features and improvements related to previews in various contexts:
-
Xcode 16:
- The session "What’s new in Xcode 16" introduced the
previewable
macro, which allows developers to attach it to property wrappers like state, enabling the creation of previews directly within a preview block without needing wrapper views. Additionally, thepreview modifier
API was introduced to facilitate sharing environment or data for previews, reducing duplicate code and enabling data caching. These enhancements make previews faster and more efficient, powered by a new execution engine. You can learn more about these improvements in the Improvements to Previews section.
- The session "What’s new in Xcode 16" introduced the
-
SwiftData:
- In the session "What’s new in SwiftData," the use of previews was discussed in the context of setting up a shared context for sample data. Developers can create a model configuration that stores data in memory only, making it easier to work on app views using Swift data queries. The
previewable
macro can also be used to create great previews for views that rely on models being passed to them. More details can be found in the Xcode previews section.
- In the session "What’s new in SwiftData," the use of previews was discussed in the context of setting up a shared context for sample data. Developers can create a model configuration that stores data in memory only, making it easier to work on app views using Swift data queries. The
-
Quick Look for visionOS:
- The session "What’s new in Quick Look for visionOS" introduced the
PreviewApplication API
, which provides more control over the Quick Look experience, including managing the lifecycle of previews and customizing editing options. This API allows for a more intuitive way to manage previewed files and enhances the 3D preview capabilities. For more information, see the PreviewApplication API section.
- The session "What’s new in Quick Look for visionOS" introduced the
These sessions highlight the advancements in preview capabilities across different Apple platforms, making it easier for developers to create and manage previews efficiently.
What’s new in Xcode 16
Discover the latest productivity and performance improvements in Xcode 16. Learn about enhancements to code completion, diagnostics, and Xcode Previews. Find out more about updates in builds and explore improvements in debugging and Instruments.
What’s new in USD and MaterialX
Explore updates to Universal Scene Description and MaterialX support on Apple platforms. Discover how these technologies provide a foundation for 3D content creation and delivery, and learn how they can help streamline your workflows for creating great spatial experiences. Learn about USD and MaterialX support in RealityKit and Storm, advancements in our system-provided tooling, and more.
What’s new in SwiftData
SwiftData makes it easy to add persistence to your app with its expressive, declarative API. Learn about refinements to SwiftData, including compound uniqueness constraints, faster queries with #Index, queries in Xcode previews, and rich predicate expressions. Join us to explore how you can use all of these features to express richer models and improve performance in your app. To discover how to build a custom data store or use the history API in SwiftData, watch “Create a custom data store with SwiftData” and “Track model changes with SwiftData history”.
What’s new in Quick Look for visionOS
Explore how Quick Look in visionOS can elevate file preview and editing experiences in your app. We’ll cover the integration of in-app and windowed Quick Look, as well as a brand-new API that customizes the windowed Quick Look experience in your app. We’ll also share the latest enhancements to viewing 3D models within Quick Look.