<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSKeyValueChangeKey/oldKey",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@NSKeyValueChangeOldKey"
  },
  "title" : "oldKey"
}
-->

# oldKey

If the value of the [`kindKey`](/documentation/Foundation/NSKeyValueChangeKey/kindKey) entry is [`NSKeyValueChange.setting`](/documentation/Foundation/NSKeyValueChange/setting), and [`old`](/documentation/Foundation/NSKeyValueObservingOptions/old) was specified when the observer was registered, the value of this key is the value before the attribute was changed.

```
static let oldKey: NSKeyValueChangeKey
```

## Discussion

For [`NSKeyValueChange.removal`](/documentation/Foundation/NSKeyValueChange/removal) or [`NSKeyValueChange.replacement`](/documentation/Foundation/NSKeyValueChange/replacement), if [`old`](/documentation/Foundation/NSKeyValueObservingOptions/old) was specified when the observer was registered, the value is an `NSArray` instance that contains the objects that have been removed or have been replaced by other objects, respectively.

---

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)