Contents

WebDataSource

WebDataSource encapsulates the web content to be displayed in a web frame view. A WebDataSource object has a representation object, conforming to the WebDocumentRepresentation protocol, that holds the data in an appropriate format depending on the MIME type. You can extend WebKit to support new MIME types by implementing your own view and representation classes, and specifying the mapping between them using the Registerclass(_:representationclass:formimetype:) WebView class method.

Declaration

class WebDataSource

Overview

WebDataSource objects have an associated initial request, possibly a modified request, and a response object. Since the data source may be in the process of being loaded, you should check the state of a data source using isLoading before accessing its data. Use data to get the raw data. Use the representation method to get the actual representation object and query it for more details.

Topics

Initializing an instance

Querying page data and state

Getting the request and response

Getting the web frame

Getting an unreachable URL

Getting a web archive

Accessing subresources

See Also

Working with Frames (Legacy)