Web view resource load delegates implement this protocol to be notified on the progress of loading individual resources. Note that there can be hundreds of resources, such as images and other media, per page. So, if you just want to get page loading status see the WebFrameLoadDelegate protocol.


@protocol WebResourceLoadDelegate


There’s a separate client request and server response made for each resource on a page. By implementing the webView:identifierForInitialRequest:fromDataSource: method, resource load delegates provide a tracking object used to identify individual resources in subsequent calls to delegate methods. Delegates are then notified when resource loading starts, when data is incrementally received, when any load errors occur, and when the load is complete. Delegates may also change a request before it is sent. In some cases, depending on the page content and server redirects, methods defined in this protocol may be invoked multiple times (see individual method descriptions for more details). All the methods in this protocol are optional.


Setting Identifiers

- webView:identifierForInitialRequest:fromDataSource:

Returns an identifier object used to track the progress of loading a single resource.

Loading Content

- webView:resource:willSendRequest:redirectResponse:fromDataSource:

Invoked before a request is initiated for a resource and returns a possibly modified request.

- webView:resource:didFinishLoadingFromDataSource:

Invoked when all of the data for a given resource is loaded.

- webView:resource:didReceiveResponse:fromDataSource:

Invoked after a resource has been loaded.

- webView:resource:didReceiveContentLength:fromDataSource:

Invoked when some of the data for a given resource has arrived.

- webView:plugInFailedWithError:dataSource:

Invoked when a plug-in fails to load.

Authenticating Resources

- webView:resource:didReceiveAuthenticationChallenge:fromDataSource:

Invoked when an authentication challenge has been received for a resource.

- webView:resource:didCancelAuthenticationChallenge:fromDataSource:

Invoked when an authentication challenge for a resource was canceled.


Inherits From

See Also

Loading Resources (Legacy)


A WebResource object represents a downloaded URL. It encapsulates the data of the download as well as other resource properties such as the URL, MIME type, and frame name.