---
title: "willChangeValue(forKey:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nsmanagedobject/willchangevalue(forkey:)"
---

# willChangeValue(forKey:)

Provides an opportunity to respond when a value of a given property is about to change.

## Declaration

```swift
func willChangeValue(forKey key: String)
```

## Parameters

- `key`: The name of the property that will change.

## Discussion

Discussion For more details, see Key-Value Observing Programming Guide. You must not override this method.

## See Also

### Supporting Key-Value Observing

- [didAccessValue(forKey:)](coredata/nsmanagedobject/didaccessvalue(forkey:).md)
- [observationInfo()](coredata/nsmanagedobject/observationinfo().md)
- [setObservationInfo(_:)](coredata/nsmanagedobject/setobservationinfo(_:).md)
- [willAccessValue(forKey:)](coredata/nsmanagedobject/willaccessvalue(forkey:).md)
- [didChangeValue(forKey:)](coredata/nsmanagedobject/didchangevalue(forkey:).md)
- [didChangeValue(forKey:withSetMutation:using:)](coredata/nsmanagedobject/didchangevalue(forkey:withsetmutation:using:).md)
- [willChangeValue(forKey:withSetMutation:using:)](coredata/nsmanagedobject/willchangevalue(forkey:withsetmutation:using:).md)
