<!--
{
  "availability" : [
    "iOS: 18.1.0 -",
    "iPadOS: 18.1.0 -",
    "macCatalyst: 18.1.0 -",
    "macOS: 15.1.0 -",
    "visionOS: 2.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ImagePlayground",
  "identifier" : "/documentation/ImagePlayground/ImagePlaygroundViewController",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Image Playground"
    ],
    "preciseIdentifier" : "c:@M@ImagePlayground@objc(cs)ImagePlaygroundViewController"
  },
  "title" : "ImagePlaygroundViewController"
}
-->

# ImagePlaygroundViewController

Displays a standard system interface to generate images from
the provided input.

```
@MainActor @objc @preconcurrency class ImagePlaygroundViewController
```

## Overview

Present an [`ImagePlaygroundViewController`](/documentation/ImagePlayground/ImagePlaygroundViewController) to display a standard
system interface to generate images from a description you provide.
People use the view controller interface to generate images and
experiment with the contents before returning an image to your app.
You can then incorporate that image into your app’s content.

Create an [`ImagePlaygroundViewController`](/documentation/ImagePlayground/ImagePlaygroundViewController) and configure it with an
initial description of the image you want before you present it.
Specify a text-based description of the image using the [`concepts`](/documentation/ImagePlayground/ImagePlaygroundViewController/concepts)
property. If you have a starting image that you want to use to create
the new image, specify your image in the [`sourceImage`](/documentation/ImagePlayground/ImagePlaygroundViewController/sourceImage) property.

Present this view controller from your interface and wait for it to
deliver results to your custom [`delegate`](/documentation/ImagePlayground/ImagePlaygroundViewController/delegate-swift.property) object. If the person
approves the image, the view controller sends that image to your app
via this delegate object. The view controller also notifies your
delegate if the person cancels the operation.

## Topics

### Creating the view controller

[`init()`](/documentation/ImagePlayground/ImagePlaygroundViewController/init())

Creates a new image-generation view controller for you to present.

### Processing a generated image

[`delegate`](/documentation/ImagePlayground/ImagePlaygroundViewController/delegate-swift.property)

The delegate object that receives the generated image and
handles events from the view controller.

[`ImagePlaygroundViewController.Delegate`](/documentation/ImagePlayground/ImagePlaygroundViewController/Delegate-swift.protocol)

An interface you use to receive images and handle events related
to an image-generation view controller.

### Specifying the configuration of the playground

[`selectedGenerationStyle`](/documentation/ImagePlayground/ImagePlaygroundViewController/selectedGenerationStyle)

Generation style to pre-select upong launching the playground among those in `allowedGenerationStyles`.

[`allowedGenerationStyles`](/documentation/ImagePlayground/ImagePlaygroundViewController/allowedGenerationStyles)

A list of allowed generation styles to choose from in the playground.

[`personalizationPolicy`](/documentation/ImagePlayground/ImagePlaygroundViewController/personalizationPolicy)

The policy to apply when determining whether to include people in generated images.

[`ImagePlaygroundPersonalizationPolicy`](/documentation/ImagePlayground/ImagePlaygroundPersonalizationPolicy)

An option for enabling or disabling personalization in the system interface.

### Specifying the source content

[`concepts`](/documentation/ImagePlayground/ImagePlaygroundViewController/concepts)

An array of elements that describes the expected contents of the image.

[`sourceImage`](/documentation/ImagePlayground/ImagePlaygroundViewController/sourceImage)

An image to use as source input for generating the new image.

### Getting the feature availability

[`isAvailable`](/documentation/ImagePlayground/ImagePlaygroundViewController/isAvailable)

A Boolean value that indicates whether image generation
is available on the current device.

### Managing the view

[`viewDidLoad()`](/documentation/ImagePlayground/ImagePlaygroundViewController/viewDidLoad())

Called after the controller’s view is loaded into memory.

[`viewDidDisappear()`](/documentation/ImagePlayground/ImagePlaygroundViewController/viewDidDisappear())

Notifies the view controller that its view is about to be removed from a
view hierarchy.

[`viewWillAppear()`](/documentation/ImagePlayground/ImagePlaygroundViewController/viewWillAppear())

Notifies the view controller that its view is about to be added to a
view hierarchy.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)