---
title: cocoaVersionDocumentAttribute
framework: foundation
role: symbol
role_heading: Type Property
path: foundation/nsattributedstring/documentattributekey/cocoaversiondocumentattribute
---

# cocoaVersionDocumentAttribute

The version of Cocoa that created the file.

## Declaration

```swift
static let cocoaVersionDocumentAttribute: NSAttributedString.DocumentAttributeKey
```

```swift
static let cocoaVersion: NSAttributedString.DocumentAttributeKey
```

## Discussion

Discussion The value of this attribute is an NSNumber object containing a float. For RTF files only, stores the version of Cocoa with which the file was created. Absence of this value indicates RTF file not created by Cocoa or its predecessors. Values less than 100 are pre–macOS; 100 is macOS 10.0 or 10.1; 102 is macOS 10.2 and 10.3; values greater than 102 correspond to values of NSAppKitVersionNumber in macOS 10.4 and later. The string constant in macOS 10.3 and earlier is @"CocoaRTFVersion".

## See Also

### Getting document metadata keys

- [author](foundation/nsattributedstring/documentattributekey/author.md)
- [category](foundation/nsattributedstring/documentattributekey/category.md)
- [characterEncoding](foundation/nsattributedstring/documentattributekey/characterencoding.md)
- [comment](foundation/nsattributedstring/documentattributekey/comment.md)
- [company](foundation/nsattributedstring/documentattributekey/company.md)
- [converted](foundation/nsattributedstring/documentattributekey/converted.md)
- [copyright](foundation/nsattributedstring/documentattributekey/copyright.md)
- [creationTime](foundation/nsattributedstring/documentattributekey/creationtime.md)
- [editor](foundation/nsattributedstring/documentattributekey/editor.md)
- [keywords](foundation/nsattributedstring/documentattributekey/keywords.md)
- [manager](foundation/nsattributedstring/documentattributekey/manager.md)
- [modificationTime](foundation/nsattributedstring/documentattributekey/modificationtime.md)
- [readOnly](foundation/nsattributedstring/documentattributekey/readonly.md)
- [subject](foundation/nsattributedstring/documentattributekey/subject.md)
- [title](foundation/nsattributedstring/documentattributekey/title.md)
