<!--
{
  "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.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Image Playground"
    ],
    "preciseIdentifier" : "c:@M@ImagePlayground@objc(cs)ImagePlaygroundViewController(py)delegate"
  },
  "title" : "delegate"
}
-->

# delegate

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

```
@MainActor @objc @preconcurrency weak var delegate: (any ImagePlaygroundViewController.Delegate)?
```

## Discussion

Set the value of this property to a custom type you define.
The view controller reports relevant interactions to your type
using the methods of the [`ImagePlaygroundViewController.Delegate`](/documentation/ImagePlayground/ImagePlaygroundViewController/Delegate-swift.protocol)
protocol. For example, the view controller notifies your
delegate when the person accepts a generated 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)