<!--
{
  "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/Delegate-swift.protocol",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Image Playground",
      "ImagePlayground"
    ],
    "preciseIdentifier" : "s:15ImagePlayground0aB14ViewControllerC8DelegateP"
  },
  "title" : "ImagePlaygroundViewController.Delegate"
}
-->

# ImagePlaygroundViewController.Delegate

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

```
@objc(ImageGenerationViewControllerDelegate) protocol Delegate : NSObjectProtocol
```

## Overview

Adopt the [`ImagePlaygroundViewController.Delegate`](/documentation/ImagePlayground/ImagePlaygroundViewController/Delegate-swift.protocol) protocol in a
custom type and assign that type as the delegate of an [`ImagePlaygroundViewController`](/documentation/ImagePlayground/ImagePlaygroundViewController)
object. When you present the view controller, the system interface
handles interactions with the person and reports the results back
to your delegate object.

## Topics

### Receiving the image

[`imagePlaygroundViewController(_:didCreateImageAt:)`](/documentation/ImagePlayground/ImagePlaygroundViewController/Delegate-swift.protocol/imagePlaygroundViewController(_:didCreateImageAt:))

Returns the generated image to the delegate.

### Handling cancellation events

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

Notifies the delegate that the person canceled the generation
of the image.



---

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)