字典就相当于OC里的NSDictionary,根据视频里的例子
| 1 2 3 4 | var dict = ["name":"superyyl","age":"16"] dict["sex"] = "Female" println(dict)//[sex: Female, name: superyyl, age: 16] println(dict["name"])//superyyl | 
好吧,这里说一下我遇到的一个问题
| 1 2 3 4 5 6 7 8 9 | var dict = ["name":"superyyl","age":16] println(dict) /* {     age = 16;     name = superyyl; } */ dict["sex"] = "Female" //error:Cannot assign to the result of the Expression | 
我觉得我既然开始时候没指定dict的value类型,就应该让我随便添加,我认为这应该算是个bug吧,不知道苹果是怎么考量的,为什么混合的value类型就不允许添加