How can use imageplayground in app
Asked on 03/06/2025
1 search
To use the Image Playground in your app, you can follow these steps as outlined in the What’s new in AppKit session:
-
Initialize the Image Playground View Controller: Start by creating an instance of the Image Playground view controller and assign its delegate. The delegate will handle important lifecycle events, such as when image creation is finished or canceled.
-
Set Up Initial Concepts and Source Imagery: If your app has specific context leading into the Image Playground experience, you can set up the view controller with initial concepts and source imagery. Concepts describe the expected contents of the output image, while the source image acts as a graphical reference.
-
Present the View Controller: Present the view controller as a sheet to allow users to start creating images. Users can choose different images and concepts within the image creation sheet.
-
Handle Image Creation Completion: Once the image is created, the view controller's delegate receives a callback with a reference to the image's file URL. This file URL is located in the app's sandboxed temporary directory.
-
Insert the Image into Your UI: Use the file URL to insert the image into your user interface, and then dismiss the playground sheet.
-
Consider Image Playground as an Image Source: If your app allows image insertion from the photo library, Finder, or Continuity Camera, consider adding Image Playground as another source of images.
This integration allows users to create images directly within your app using the Image Playground's capabilities, which run locally on the device without the need for external models or servers.

Bring your iOS or iPadOS game to visionOS
Discover how to transform your iOS or iPadOS game into a uniquely visionOS experience. Increase the immersion (and fun factor!) with a 3D frame or an immersive background. And invite players further into your world by adding depth to the window with stereoscopy or head tracking.

What’s new in privacy
At Apple, we believe privacy is a fundamental human right. Learn about new and improved permission flows and other features that manage data in a privacy-preserving way, so that you can focus on creating great app experiences.

Discover RealityKit APIs for iOS, macOS and visionOS
Learn how new cross-platform APIs in RealityKit can help you build immersive apps for iOS, macOS, and visionOS. Check out the new hover effects, lights and shadows, and portal crossing features, and view them in action through real examples.