---
title: NSKeyValueObserving
framework: objectivec
role: collectionGroup
role_heading: API Collection
path: objectivec/nskeyvalueobserving
---

# NSKeyValueObserving

An informal protocol that objects adopt to be notified of changes to the specified properties of other objects.

## Overview

Overview You can observe any object properties including simple attributes, to-one relationships, and to-many relationships. Observers of to-many relationships are informed of the type of change made — as well as which objects are involved in the change. NSObject provides an implementation of the NSKeyValueObserving protocol that provides an automatic observing capability for all objects. You can further refine notifications by disabling automatic observer notifications and implementing manual notifications using the methods in this protocol.

## Topics

### Change Notification

- [observeValue(forKeyPath:of:change:context:)](objectivec/nsobject-swift.class/observevalue(forkeypath:of:change:context:).md)

### Registering for Observation

- [addObserver(_:forKeyPath:options:context:)](objectivec/nsobject-swift.class/addobserver(_:forkeypath:options:context:).md)
- [removeObserver(_:forKeyPath:)](objectivec/nsobject-swift.class/removeobserver(_:forkeypath:).md)
- [removeObserver(_:forKeyPath:context:)](objectivec/nsobject-swift.class/removeobserver(_:forkeypath:context:).md)

### Notifying Observers of Changes

- [willChangeValue(forKey:)](objectivec/nsobject-swift.class/willchangevalue(forkey:).md)
- [didChangeValue(forKey:)](objectivec/nsobject-swift.class/didchangevalue(forkey:).md)
- [willChange(_:valuesAt:forKey:)](objectivec/nsobject-swift.class/willchange(_:valuesat:forkey:).md)
- [didChange(_:valuesAt:forKey:)](objectivec/nsobject-swift.class/didchange(_:valuesat:forkey:).md)
- [willChangeValue(forKey:withSetMutation:using:)](objectivec/nsobject-swift.class/willchangevalue(forkey:withsetmutation:using:).md)
- [didChangeValue(forKey:withSetMutation:using:)](objectivec/nsobject-swift.class/didchangevalue(forkey:withsetmutation:using:).md)

### Observing Customization

- [automaticallyNotifiesObservers(forKey:)](objectivec/nsobject-swift.class/automaticallynotifiesobservers(forkey:).md)
- [keyPathsForValuesAffectingValue(forKey:)](objectivec/nsobject-swift.class/keypathsforvaluesaffectingvalue(forkey:).md)
- [NSKeyValueObservingCustomization](foundation/nskeyvalueobservingcustomization.md)
- [observationInfo](objectivec/nsobject-swift.class/observationinfo.md)

### Constants

- [NSKeyValueObservation](foundation/nskeyvalueobservation.md)
- [NSKeyValueObservedChange](foundation/nskeyvalueobservedchange.md)
- [NSKeyValueChange](foundation/nskeyvaluechange.md)
- [NSKeyValueObservingOptions](foundation/nskeyvalueobservingoptions.md)
- [NSKeyValueChangeKey](foundation/nskeyvaluechangekey.md)
- [NSKeyValueSetMutationKind](foundation/nskeyvaluesetmutationkind.md)

## See Also

### Related Documentation

- [Key-Value Observing Programming Guide](apple-archive/documentation/Cocoa/Conceptual/KeyValueObserving.md)
