<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/CSCustomAttributeKey/keyName",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Spotlight"
    ],
    "preciseIdentifier" : "c:objc(cs)CSCustomAttributeKey(py)keyName"
  },
  "title" : "keyName"
}
-->

# keyName

The name of the custom attribute key.

```
var keyName: String { get }
```

## Discussion

The key name is a string that contains only ASCII characters and no punctuation other than the underscore (that is “_”). The prefix `kMD` is reserved. To create a custom attribute key name, it’s recommended that you use a reverse DNS format that includes your company name and does not include the period character (”.”). For example, a key name of the form `com_mycompany_myapp_mykeyname` works well.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)