#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).