---
title: "setValuesForKeys(_:)"
framework: objectivec
role: symbol
role_heading: Instance Method
path: "objectivec/nsobject-swift.class/setvaluesforkeys(_:)"
---

# setValuesForKeys(_:)

Sets properties of the receiver with values from a given dictionary, using its keys to identify the properties.

## Declaration

```swift
func setValuesForKeys(_ keyedValues: [String : Any])
```

## Parameters

- `keyedValues`: A dictionary whose keys identify properties in the receiver. The values of the properties in the receiver are set to the corresponding values in the dictionary.

## Discussion

Discussion The default implementation invokes setValue(_:forKey:) for each key-value pair, substituting nil for NSNull values in keyedValues.

## See Also

### Related Documentation

- [dictionaryWithValues(forKeys:)](objectivec/nsobject-swift.class/dictionarywithvalues(forkeys:).md)

### Setting Values

- [setValue(_:forKeyPath:)](objectivec/nsobject-swift.class/setvalue(_:forkeypath:).md)
- [setNilValueForKey(_:)](objectivec/nsobject-swift.class/setnilvalueforkey(_:).md)
- [setValue(_:forKey:)](objectivec/nsobject-swift.class/setvalue(_:forkey:).md)
- [setValue(_:forUndefinedKey:)](objectivec/nsobject-swift.class/setvalue(_:forundefinedkey:).md)
