<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Quartz",
  "identifier" : "/documentation/Quartz/IKCameraDeviceViewDelegate/cameraDeviceView(_:didDownloadFile:location:fileData:error:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Quartz"
    ],
    "preciseIdentifier" : "c:objc(pl)IKCameraDeviceViewDelegate(im)cameraDeviceView:didDownloadFile:location:fileData:error:"
  },
  "title" : "cameraDeviceView(_:didDownloadFile:location:fileData:error:)"
}
-->

# cameraDeviceView(_:didDownloadFile:location:fileData:error:)

Invoked for each file that is downloaded from the camera device.

```
optional func cameraDeviceView(_ cameraDeviceView: IKCameraDeviceView!, didDownloadFile file: ICCameraFile!, location url: URL!, fileData data: Data!, error: (any Error)!)
```

## Parameters

`cameraDeviceView`

The camera device view that sent the message.

`file`

The camera file.

`url`

The URL to save the data.

`data`

The data.

`error`

Any errors encountered during downloading.

## Discussion

If the [`IKCameraDeviceView`](/documentation/Quartz/IKCameraDeviceView) [`transferMode`](/documentation/Quartz/IKCameraDeviceView/transferMode) property is [`IKCameraDeviceViewTransferMode.fileBased`](/documentation/Quartz/IKCameraDeviceViewTransferMode/fileBased) then camera file will have been saved to  `url`. The URL will be a complete path to save the file, including a ‘sequence number’ if the file already exists.

If the [`transferMode`](/documentation/Quartz/IKCameraDeviceView/transferMode) is [`IKCameraDeviceViewTransferMode.memoryBased`](/documentation/Quartz/IKCameraDeviceViewTransferMode/memoryBased) then the `data` parameter contains the image data and can be handled as appropriate for your application.

In case of an error, the passed data (both `url` and `data`) will be `NULL` and `error` (which may come directly from the camera module / or the ImageCaptureCore framework) will describe why the download or save failed.

---

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)