<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/automaticallyNotifiesObservers(forKey:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Objective-C Runtime",
      "ObjectiveC"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(cm)automaticallyNotifiesObserversForKey:"
  },
  "title" : "automaticallyNotifiesObservers(forKey:)"
}
-->

# automaticallyNotifiesObservers(forKey:)

Returns a Boolean value that indicates whether the observed object supports automatic key-value observation for the given key.

```
class func automaticallyNotifiesObservers(forKey key: String) -> Bool
```

## Return Value

[`YES`](/documentation/ObjectiveC/YES) if the key-value observing machinery should automatically invoke [`willChangeValue(forKey:)`](/documentation/ObjectiveC/NSObject-swift.class/willChangeValue(forKey:))/[`didChangeValue(forKey:)`](/documentation/ObjectiveC/NSObject-swift.class/didChangeValue(forKey:)) and [`willChange(_:valuesAt:forKey:)`](/documentation/ObjectiveC/NSObject-swift.class/willChange(_:valuesAt:forKey:))/[`didChange(_:valuesAt:forKey:)`](/documentation/ObjectiveC/NSObject-swift.class/didChange(_:valuesAt:forKey:)) whenever instances of the class receive key-value coding messages for the `key`, or mutating key-value-coding-compliant methods for the `key` are invoked; otherwise [`NO`](/documentation/ObjectiveC/NO).

## Discussion

The default implementation returns [`YES`](/documentation/ObjectiveC/YES). Starting in OS X 10.5, the default implementation of this method searches the receiving class for a method whose name matches the pattern `+automaticallyNotifiesObserversOf<Key>`, and returns the result of invoking that method if it is found. Any found methods must return `BOOL`. If no such method is found [`YES`](/documentation/ObjectiveC/YES) is returned.

---

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)