---
title: WebDocumentRepresentation
framework: webkit
role: symbol
role_heading: Protocol
path: webkit/webdocumentrepresentation
---

# WebDocumentRepresentation

This protocol is adopted by document representation classes that handle specific MIME types. You can implement your own document view classes and document representation classes to render data for specific MIME types, and register those classes using the WebFrame registerClass(_:representationClass:forMIMEType:) method.

## Declaration

```swift
protocol WebDocumentRepresentation : NSObjectProtocol
```

## Topics

### Setting the data source

- [setDataSource(_:)](webkit/webdocumentrepresentation/setdatasource(_:).md)

### Loading content

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

### Getting document source

- [canProvideDocumentSource()](webkit/webdocumentrepresentation/canprovidedocumentsource().md)
- [documentSource()](webkit/webdocumentrepresentation/documentsource().md)

### Getting the document title

- [title()](webkit/webdocumentrepresentation/title().md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Working With Document Web Views (Legacy)

- [WebDocumentSearching](webkit/webdocumentsearching.md)
- [WebDocumentText](webkit/webdocumenttext.md)
- [WebDocumentView](webkit/webdocumentview.md)
