---
title: "receivedData(_:with:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webdocumentrepresentation/receiveddata(_:with:)"
---

# receivedData(_:with:)

Invoked when a data source has received some data.

## Declaration

```swift
func receivedData(_ data: Data!, with dataSource: WebDataSource!)
```

## Parameters

- `data`: An NSData object containing the data received.
- `dataSource`: A WebDataSource object that identifies the request that generated this data.

## Discussion

Discussion Data is loaded incrementally, so this method may be invoked multiple times. The receiver is responsible for accumulating this data.

## See Also

### Loading content

- [receivedError(_:with:)](webkit/webdocumentrepresentation/receivederror(_:with:).md)
- [finishedLoading(with:)](webkit/webdocumentrepresentation/finishedloading(with:).md)
