---
title: URLSessionDownloadDelegate
framework: foundation
role: symbol
role_heading: Protocol
path: foundation/urlsessiondownloaddelegate
---

# URLSessionDownloadDelegate

A protocol that defines methods that URL session instances call on their delegates to handle task-level events specific to download tasks.

## Declaration

```swift
protocol URLSessionDownloadDelegate : URLSessionTaskDelegate
```

## Mentioned in

Downloading files from websites Downloading files in the background Fetching website data into memory

## Overview

Overview In addition to the methods in this protocol, be sure to implement the methods in the URLSessionTaskDelegate and URLSessionDelegate protocols to handle events common to all task types and session-level events, respectively. note: An URLSession object need not have a delegate. If no delegate is assigned, a system-provided delegate is used, and you must provide a completion callback to obtain the data.

## Topics

### Handling download life cycle changes

- [urlSession(_:downloadTask:didFinishDownloadingTo:)](foundation/urlsessiondownloaddelegate/urlsession(_:downloadtask:didfinishdownloadingto:).md)

### Resuming paused downloads

- [urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)](foundation/urlsessiondownloaddelegate/urlsession(_:downloadtask:didresumeatoffset:expectedtotalbytes:).md)

### Receiving progress updates

- [urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)](foundation/urlsessiondownloaddelegate/urlsession(_:downloadtask:didwritedata:totalbyteswritten:totalbytesexpectedtowrite:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [URLSessionDelegate](foundation/urlsessiondelegate.md)
- [URLSessionTaskDelegate](foundation/urlsessiontaskdelegate.md)

## See Also

### Adding download tasks to a session

- [downloadTask(with:)](foundation/urlsession/downloadtask(with:)-1onj.md)
- [downloadTask(with:completionHandler:)](foundation/urlsession/downloadtask(with:completionhandler:)-7cuje.md)
- [downloadTask(with:)](foundation/urlsession/downloadtask(with:)-3fb7s.md)
- [downloadTask(with:completionHandler:)](foundation/urlsession/downloadtask(with:completionhandler:)-4a84s.md)
- [downloadTask(withResumeData:)](foundation/urlsession/downloadtask(withresumedata:).md)
- [downloadTask(withResumeData:completionHandler:)](foundation/urlsession/downloadtask(withresumedata:completionhandler:).md)
- [URLSessionDownloadTask](foundation/urlsessiondownloadtask.md)
