Instance Propertyswift 6.0.3Swift

values

A collection containing just the values of the dictionary.

Swift
4.0+
var values: Dictionary<Key, Value>.Values { get set }

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"