---
title: "imagePickerControllerDidCancel(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiimagepickercontrollerdelegate/imagepickercontrollerdidcancel(_:)"
---

# imagePickerControllerDidCancel(_:)

Tells the delegate that the user canceled the pick operation.

## Declaration

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

## Parameters

- `picker`: The controller object managing the image picker interface.

## Discussion

Discussion Your delegate’s implementation of this method should dismiss the picker view by calling the dismiss(animated:completion:) method of the parent view controller. Implementation of this method is optional, but expected.

## See Also

### Closing the picker

- [imagePickerController(_:didFinishPickingMediaWithInfo:)](uikit/uiimagepickercontrollerdelegate/imagepickercontroller(_:didfinishpickingmediawithinfo:).md)
