Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift Access Elements from Dictionary

var cities = ["Nepal":"Kathmandu", "China":"Beijing", "Japan":"Tokyo"]

print("Dictionary: ", cities)

// cities.keys return all keys of cities
var countryName  = Array(cities.keys)

print("Keys: ", countryName)
 
PREVIOUS NEXT
Tagged: #Swift #Access #Elements #Dictionary
ADD COMMENT
Topic
Name
8+5 =