---
title: "willChangeValue(forKey:withSetMutation:using:)"
framework: objectivec
role: symbol
role_heading: Instance Method
path: "objectivec/nsobject-swift.class/willchangevalue(forkey:withsetmutation:using:)"
---

# willChangeValue(forKey:withSetMutation:using:)

Informs the observed object that the specified change is about to be made to a specified unordered to-many relationship.

## Declaration

```swift
func willChangeValue(forKey key: String, withSetMutation mutationKind: NSKeyValueSetMutationKind, using objects: Set<AnyHashable>)
```

## Parameters

- `key`: The name of a property that is an unordered to-many relationship
- `mutationKind`: The type of change that will be made.
- `objects`: The objects that are involved in the change (see doc://com.apple.documentation/documentation/Foundation/NSKeyValueSetMutationKind).

## Discussion

Discussion Use this method when implementing key-value observer compliance manually. important: After the values have been changed, a corresponding didChangeValue(forKey:withSetMutation:using:) must be invoked with the same parameters. Special Considerations You rarely need to override this method in subclasses, but if you do, be sure to call super.

## See Also

### 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)
- [didChangeValue(forKey:withSetMutation:using:)](objectivec/nsobject-swift.class/didchangevalue(forkey:withsetmutation:using:).md)
