Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift Add Elements to a Dictionary

var capitalCity = ["Nepal": "Kathmandu", "England": "London"]
print("Initial Dictionary: ",capitalCity)

capitalCity["Japan"] = "Tokyo"

print("Updated Dictionary: ",capitalCity)
print(capitalCity["Japan"])
 
PREVIOUS NEXT
Tagged: #Swift #Add #Elements #Dictionary
ADD COMMENT
Topic
Name
4+4 =