---
title: "value(forCustomKey:)"
framework: corespotlight
role: symbol
role_heading: Instance Method
path: "corespotlight/cssearchableitemattributeset/value(forcustomkey:)"
---

# value(forCustomKey:)

Returns the value associated with the specified custom attribute key.

## Declaration

```swift
func value(forCustomKey key: CSCustomAttributeKey) -> (any NSSecureCoding)?
```

## Parameters

- `key`: The custom attribute key.

## Return Value

Return Value The value associated with the custom attribute key.

## See Also

### Accessing custom attributes

- [setValue(_:forCustomKey:)](corespotlight/cssearchableitemattributeset/setvalue(_:forcustomkey:).md)
