Question : create dictionary swift
Answered by : sej
var someDict:[String:Int] = ["One":1, "Two":2, "Three":3] // creates dictionary
var someVar = someDict["One"] // accesses the value of key "One"
print("The value of key = One is \(someVar)")
Source : | Last Update : Tue, 23 Jun 20
Question : Swift Dictionary
Answered by : samer-saeid
// dictionary with keys and values of different data types
var numbers = [1: "One", 2: "Two", 3: "Three"]
print(numbers)
Source : | Last Update : Thu, 23 Jun 22
Question : Create a dictionary in Swift
Answered by : samer-saeid
var capitalCity = ["Nepal": "Kathmandu", "Italy": "Rome", "England": "London"]
print(capitalCity)
Source : | Last Update : Thu, 23 Jun 22