<!--
{
  "availability" : [
    "macOS: 10.3.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebResourceLoadDelegate/webView(_:resource:didReceive:from:)-22bdg",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WebResourceLoadDelegate(im)webView:resource:didReceiveResponse:fromDataSource:"
  },
  "title" : "webView(_:resource:didReceive:from:)"
}
-->

# webView(_:resource:didReceive:from:)

Invoked after a resource has been loaded.

```
optional func webView(_ sender: WebView!, resource identifier: Any!, didReceive response: URLResponse!, from dataSource: WebDataSource!)
```

## Parameters

`sender`

The web view that sent this message.

`identifier`

An identifier object used to track the resource being loaded by `dataSource`.

`response`

The reply that was received.

`dataSource`

The data source for this web view.

## Discussion

In some rare cases, multiple responses may be received for a single resource. This happens in the case of multipart/x-mixed-replace, also known as a *server push*. In this case, delegates should assume that the progress of loading this resource restarts, and the expected content length may change.

---

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)