<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIImagePickerControllerDelegate/imagePickerControllerDidCancel(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIImagePickerControllerDelegate(im)imagePickerControllerDidCancel:"
  },
  "title" : "imagePickerControllerDidCancel(_:)"
}
-->

# imagePickerControllerDidCancel(_:)

Tells the delegate that the user canceled the pick operation.

```
optional func imagePickerControllerDidCancel(_ picker: UIImagePickerController)
```

## Parameters

`picker`

The controller object managing the image picker interface.

## Discussion

Your delegate’s implementation of this method should dismiss the picker view by calling the [`dismiss(animated:completion:)`](/documentation/UIKit/UIViewController/dismiss(animated:completion:)) method of the parent view controller.

Implementation of this method is optional, but expected.

---

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)