// 字典 var users = [1:"jiang", 2:"jzh", 3:"hao"] for (key, value) in users { print("\(key):\(value)") } for key in users.keys { print(key) } for values in users.values { print(values) } users.updateValue("haohao", forKey:3) print(users[3] ?? "")
// 字典 var users = [1:"jiang", 2:"jzh", 3:"hao"] for (key, value) in users { print("\(key):\(value)") } for key in users.keys { print(key) } for values in users.values { print(values) } users.updateValue("haohao", forKey:3) print(users[3] ?? "")