---
title: key
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsscriptobjectspecifier/key
---

# key

Sets the key of the receiver.

## Declaration

```swift
var key: String { get set }
```

## Parameters

- `key`: The key for the receiver.

## See Also

### Getting and setting object keys

- [keyClassDescription](foundation/nsscriptobjectspecifier/keyclassdescription.md)
