---
title: CSCustomAttributeKey
framework: corespotlight
role: symbol
role_heading: Class
path: corespotlight/cscustomattributekey
---

# CSCustomAttributeKey

A key associated with a custom attribute for a searchable item.

## Declaration

```swift
class CSCustomAttributeKey
```

## Overview

Overview The CSCustomAttributeKey class defines a key that you can associate with a custom attribute for a searchable item. Item attributes provide metadata about the item that can be indexed and displayed to users in search results. Although the Core Spotlight framework provides several predefined attributes, such as title and description, you can create a CSCustomAttributeKey object to specify a custom attribute that makes sense in your domain.

## Topics

### Creating a custom attribute

- [init(keyName:)](corespotlight/cscustomattributekey/init(keyname:).md)
- [init(keyName:searchable:searchableByDefault:unique:multiValued:)](corespotlight/cscustomattributekey/init(keyname:searchable:searchablebydefault:unique:multivalued:).md)
- [init(coder:)](corespotlight/cscustomattributekey/init(coder:).md)

### Getting the attribute details

- [keyName](corespotlight/cscustomattributekey/keyname.md)
- [isMultiValued](corespotlight/cscustomattributekey/ismultivalued.md)
- [isSearchable](corespotlight/cscustomattributekey/issearchable.md)
- [isSearchableByDefault](corespotlight/cscustomattributekey/issearchablebydefault.md)
- [isUnique](corespotlight/cscustomattributekey/isunique.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Searchable items

- [CSSearchableItem](corespotlight/cssearchableitem.md)
- [CSSearchableItemAttributeSet](corespotlight/cssearchableitemattributeset.md)
- [CSLocalizedString](corespotlight/cslocalizedstring.md)
- [CSPerson](corespotlight/csperson.md)
