---
title: NSURLConnectionDataDelegate
framework: foundation
role: symbol
role_heading: Protocol
path: foundation/nsurlconnectiondatadelegate
---

# NSURLConnectionDataDelegate

A protocol that most delegates of a URL connection implement to receive data associated with the connection.

## Declaration

```swift
protocol NSURLConnectionDataDelegate : NSURLConnectionDelegate
```

## Overview

Overview The NSURLConnectionDataDelegate protocol describes methods that should be implemented by the delegate for an instance of the NSURLConnection class. Many methods in this protocol existed as part of an informal protocol in previous versions of macOS and iOS. In addition to the methods described in this protocol, an NSURLConnection delegate should also implement the methods described in the NSURLConnectionDelegate protocol. note: If you are using NSURLConnection as part of Newsstand Kit on iOS, you should also implement the methods in the NSURLConnectionDownloadDelegate protocol.

## Topics

### Handling Incoming Data

- [connection(_:didReceive:)](foundation/nsurlconnectiondatadelegate/connection(_:didreceive:)-8t66w.md)
- [connection(_:didReceive:)](foundation/nsurlconnectiondatadelegate/connection(_:didreceive:)-8p5vg.md)

### Receiving Connection Progress

- [connection(_:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:)](foundation/nsurlconnectiondatadelegate/connection(_:didsendbodydata:totalbyteswritten:totalbytesexpectedtowrite:).md)
- [connectionDidFinishLoading(_:)](foundation/nsurlconnectiondatadelegate/connectiondidfinishloading(_:).md)

### Handling Redirects

- [connection(_:willSend:redirectResponse:)](foundation/nsurlconnectiondatadelegate/connection(_:willsend:redirectresponse:).md)
- [connection(_:needNewBodyStream:)](foundation/nsurlconnectiondatadelegate/connection(_:neednewbodystream:).md)

### Overriding Caching Behavior

- [connection(_:willCacheResponse:)](foundation/nsurlconnectiondatadelegate/connection(_:willcacheresponse:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSURLConnectionDelegate](foundation/nsurlconnectiondelegate.md)

## See Also

### URL Connection

- [NSURLConnection](foundation/nsurlconnection.md)
- [NSURLConnectionDelegate](foundation/nsurlconnectiondelegate.md)
- [NSURLConnectionDownloadDelegate](foundation/nsurlconnectiondownloaddelegate.md)
