八月第四周:

1.如何破解Alfred3:

https://www.jianshu.com/p/5b3f98b1f7b6

 

2.学习了一篇精品文章:我真的要做一辈子的程序员吗?

https://mp.weixin.qq.com/s/zeSgti_uxaSNzYkaAfct-g

 

3.元组:

对元组中的元素进行修改,注意只能修改,不能添加或者删除,any类型可以改为任何类型

 

4.字典的合并: 

 //即使类型一致也不能相加进行合并

//let dict1 = ["name":"summer", "age" : 18] as [String : Any]

//let dict2 = ["sex" : "男", "phoneNumber" : "+86 0393"] as [String : Any]

//

//let resultDict = dict1 + dict2  //写法是错误的

 

//如果必须合并  那么只能

var dict1 = ["name":"summer", "age" : 18] as [String : Any]

let dict2 = ["sex" : "男", "phoneNumber" : "+86 0393"] as [String : Any]

 

for (key, value) in dict2{

    dict1[key] = value as AnyObject?

}

posted on 2018-09-01 11:46  玉思盈蝶  阅读(162)  评论(0编辑  收藏  举报

导航