Structure

NSAttributedString.DocumentReadingOptionKey

Options for importing documents

Declaration

struct DocumentReadingOptionKey

Overview

Use these strings as keys when importing documents using the init(data:options:documentAttributes:), init(html:options:documentAttributes:), and init(url:options:documentAttributes:) methods of NSAttributedString. You can also use them from the read(from:options:documentAttributes:error:) and read(from:options:documentAttributes:error:) methods of NSMutableAttributedString.

Topics

Keys

static let baseURL: NSAttributedString.DocumentReadingOptionKey

For HTML documents; NSURL containing base URL. Previous string constant was @"BaseURL"

static let characterEncoding: NSAttributedString.DocumentReadingOptionKey

For plain text documents; NSNumber containing the unsigned int NSStringEncoding to override any encoding specified in an HTML document. Previous string constant was @"CharacterEncoding".

static let defaultAttributes: NSAttributedString.DocumentReadingOptionKey

For plain text documents; NSDictionary containing attributes to be applied to plain files. Previous string constant was @"DefaultAttributes".

static let documentType: NSAttributedString.DocumentReadingOptionKey

One of the document types described in Document Types, indicating a document type to be forced when loading the document. Previous string constant was @"DocumentType".

static let fileType: NSAttributedString.DocumentReadingOptionKey

The value of this attribute is an NSString object indicating a document type to be forced when loading the document, specified as a UTI string; mutually exclusive with documentType.

static let textEncodingName: NSAttributedString.DocumentReadingOptionKey

NSString containing the name, IANA or otherwise, of a text encoding to override any encoding specified in an HTML document. Mutually exclusive with @"CharacterEncoding". Previous string constant was @"TextEncodingName".

static let textSizeMultiplier: NSAttributedString.DocumentReadingOptionKey

Specifies a scale factor for font sizes. NSNumber containing float, default 1.0; for HTML only, corresponding to WebView's textSizeMultiplier.

static let timeout: NSAttributedString.DocumentReadingOptionKey

NSNumber containing float. Time in seconds to wait for a document to finish loading. Previous string constant was @"Timeout".

static let webPreferences: NSAttributedString.DocumentReadingOptionKey

WebPreferences; for HTML only, specifies a WebPreferences object. If not present, a default set of preferences is used. Previous string constant was @"WebPreferences".

static let webResourceLoadDelegate: NSAttributedString.DocumentReadingOptionKey

NSObject; for HTML only, specifies an object to serve as the web resource loading delegate.

Relationships