fileWrapper(from:documentAttributes:)
Returns a file wrapper object that contains a text stream corresponding to the characters and attributes within the specified range.
Declaration
func fileWrapper(from range: NSRange, documentAttributes dict: [NSAttributedString.DocumentAttributeKey : Any] = [:]) throws -> FileWrapperParameters
- range:
The range.
- dict:
A required dictionary specifying the document attributes. The dictionary contains values from
Document Typesand must at least contain Documenttype.
Return Value
Returns a file wrapper for the appropriate document type, or nil if failure. When nil, error encapsulates the error information.
Discussion
Raises an rangeException if any part of range lies beyond the end of the receiver’s characters.