Contents

rtf(from:)

Returns an NSData object that contains an RTF stream corresponding to the characters and attributes within aRange, omitting any attachment characters and attributes.

Declaration

func rtf(from range: NSRange) -> Data?

Discussion

Raises an NSRangeException if any part of aRange lies beyond the end of the receiver’s characters.

When writing data to the pasteboard, you can use the NSData object as the first argument to NSPasteboard’s setData(_:forType:) method, with a second argument of NSRTFPboardType.

See Also

Reading and writing RTF files