---
title: delegate
framework: visionkit
role: symbol
role_heading: Instance Property
path: visionkit/vndocumentcameraviewcontroller/delegate
---

# delegate

The delegate to be notified when the user saves or cancels the document scanner.

## Declaration

```swift
weak var delegate: (any VNDocumentCameraViewControllerDelegate)? { get set }
```

## Overview

Overview The delegate receives one of the following three calls: documentCameraViewController(_:didFinishWith:) when the camera successfully completes a scan. documentCameraViewControllerDidCancel(_:) when the user cancels out of the document camera interface. documentCameraViewController(_:didFailWithError:) when the document scan fails or is unable to capture a photo. Your app is responsible for dismissing the document camera in all delegate methods.

## See Also

### Supporting the document camera

- [isSupported](visionkit/vndocumentcameraviewcontroller/issupported.md)
