Contents

readOnly

An indication of whether the document is read-only.

Declaration

static let readOnly: NSAttributedString.DocumentAttributeKey

Discussion

The value of this attribute is an NSNumber object that contains an integer. A value of 1 indicates read-only. If the value is 0, missing, or negative, the document doesn’t display as read-only.

This attribute is not related to the file system protection on the file. Instead, this attribute can affect how the file displays to the user.

The string constant in macOS 10.3 and earlier is @"ReadOnly".

See Also

Getting document metadata keys