---
title: "connectionDidFinishDownloading(_:destinationURL:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsurlconnectiondownloaddelegate/connectiondidfinishdownloading(_:destinationurl:)"
---

# connectionDidFinishDownloading(_:destinationURL:)

Sent to the delegate when the URL connection has successfully downloaded the URL asset to a destination file.

## Declaration

```swift
func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL)
```

## Parameters

- `connection`: The URL connection object that downloaded the asset.
- `destinationURL`: A file URL specifying a destination in the file system. For iOS applications, this is a location in the application sandbox.

## Discussion

Discussion This method will be called once after a successful download. The file downloaded to destinationURL is guaranteed to exist there only for the duration of this method implementation; the delegate should copy or move the file to a more persistent and appropriate location.

## See Also

### Managing Downloads of URL Assets

- [connection(_:didWriteData:totalBytesWritten:expectedTotalBytes:)](foundation/nsurlconnectiondownloaddelegate/connection(_:didwritedata:totalbyteswritten:expectedtotalbytes:).md)
- [connectionDidResumeDownloading(_:totalBytesWritten:expectedTotalBytes:)](foundation/nsurlconnectiondownloaddelegate/connectiondidresumedownloading(_:totalbyteswritten:expectedtotalbytes:).md)
