---
title: values
framework: swift
role: symbol
role_heading: Instance Property
path: swift/dictionary/values-swift.property
---

# values

A collection containing just the values of the dictionary.

## Declaration

```swift
var values: Dictionary<Key, Value>.Values { get set }
```

## Discussion

Discussion When iterated over, values appear in this collection in the same order as they occur in the dictionary’s key-value pairs. let countryCodes = ["BR": "Brazil", "GH": "Ghana", "JP": "Japan"] print(countryCodes) // Prints "["BR": "Brazil", "JP": "Japan", "GH": "Ghana"]"

for v in countryCodes.values {     print(v) } // Prints "Brazil" // Prints "Japan" // Prints "Ghana"

## See Also

### Accessing Keys and Values

- [subscript(_:)](swift/dictionary/subscript(_:)-8rfql.md)
- [subscript(_:default:)](swift/dictionary/subscript(_:default:).md)
- [index(forKey:)](swift/dictionary/index(forkey:).md)
- [subscript(_:)](swift/dictionary/subscript(_:)-4bhoo.md)
- [keys](swift/dictionary/keys-swift.property.md)
- [first](swift/dictionary/first.md)
- [randomElement()](swift/dictionary/randomelement().md)
- [randomElement(using:)](swift/dictionary/randomelement(using:).md)
