#Playground
Asked on 06/11/2025
1 search
The new Playground feature in Xcode was introduced at WWDC 2025. It allows developers to quickly iterate on any code by adding a playground inline in their document. The results of the code execution appear in their own Canvas tab, similar to SwiftUI previews. This feature is particularly useful for experimenting with code, understanding existing code, and trying out new ideas.
The Playground macro is open-sourced, making it accessible to Swift developers on other platforms. It is also integrated with the Foundation Models framework, allowing developers to test and refine prompts for on-device AI models efficiently.
For more details, you can refer to the session What’s new in Xcode (03:42) and Meet the Foundation Models framework (20:50).

What’s new in Xcode
Discover the latest productivity and performance advancements in Xcode 26. Learn how to leverage large language models in your development workflow. Explore editing and debugging enhancements, improved performance and testing tools, and Swift Build - the open-source build system engine used by Xcode.

Explore prompt design & safety for on-device foundation models
Design generative AI experiences that leverage the strengths of the Foundation Models framework. We’ll start by showing how to design prompts for the on-device large language model at the core of Apple Intelligence. Then, we’ll introduce key ideas around AI safety, and offer concrete strategies to make your generative AI features safe, reliable, and delightful.

Meet the Foundation Models framework
Learn how to tap into the on-device large language model behind Apple Intelligence! This high-level overview covers everything from guided generation for generating Swift data structures and streaming for responsive experiences, to tool calling for integrating data sources and sessions for context management. This session has no prerequisites.