---
title: "set(_:forKey:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsubiquitouskeyvaluestore/set(_:forkey:)-1xml0"
---

# set(_:forKey:)

Sets the value of the specified key to a double value.

## Declaration

```swift
func set(_ value: Double, forKey aKey: String)
```

## Parameters

- `value`: The double value to save to the iCloud key-value store.
- `aKey`: The key to associate with the value.

## Discussion

Discussion This method places the double value in an NSNumber type before writing the key and value to the store.

## See Also

### Setting values

- [set(_:forKey:)](foundation/nsubiquitouskeyvaluestore/set(_:forkey:)-8o8mq.md)
- [set(_:forKey:)](foundation/nsubiquitouskeyvaluestore/set(_:forkey:)-7tt20.md)
- [set(_:forKey:)](foundation/nsubiquitouskeyvaluestore/set(_:forkey:)-2rlp.md)
- [set(_:forKey:)](foundation/nsubiquitouskeyvaluestore/set(_:forkey:)-3ga7z.md)
- [set(_:forKey:)](foundation/nsubiquitouskeyvaluestore/set(_:forkey:)-9e3de.md)
- [set(_:forKey:)](foundation/nsubiquitouskeyvaluestore/set(_:forkey:)-40a8f.md)
- [set(_:forKey:)](foundation/nsubiquitouskeyvaluestore/set(_:forkey:)-9vmlm.md)
