IOS Mobile Application Development
Session 7 Swift IOS Code
/// What is Dictionary
let valuesDict:[String:Int] = ["A":1, "B":33, "C":66]
let valuesDict1 = ["A":1, "B":33, "C":66]
let valuesDict2:[Int:String] = [1:"A", 33:"B", 66:"C"]
print(valuesDict)
print(valuesDict1)
print(valuesDict2)
let emptyDict:[String:Int] = [:]
print(emptyDict)
print(valuesDict["A"])
for (i,j) in valuesDict
{
print("\(i) \(j)")
}
print(valuesDict.count)
print(emptyDict.isEmpty)
No comments:
Post a Comment
Fell free to write your query in comment. Your Comments will be fully encouraged.