A dictionary is made up of key-value pairs. The values
property in Swift only returns the dictionary’s values without returning the keys.
dictionary.values
The value returned is a collection containing the values of the Dictionary
instance dictionary
.
// create a dictionaryvar phones = ["S" : "Samsung","I" : "Iphone","G" : "Gionee","T" : "Tecno"]// get only the values of the dictionaryprint(phones.values)
phones
and populate it with some elements.values
property. The values are then printed to the console.