数组和字典 swift

var array = ["A","B"]

var array2:[String] = ["A","B"]

var array3:Array

count

isEmpty

insert

removeAtIndex

removeLast

遍历

for index in 0,,array.count

{

}

for item in array

{

}

for (index,item) in enumerate(array)

{

}

字典

Dictionary

[int:String][String:String]

创建

var dict = Dictionary

var courses = [1:"语文",2:"数学"]

courses[1]

删除

courses[1] = nil

count

isEmpty

遍历

for (key,value) in courses

{

}

keys

values

上一篇:第三个Sprint ------第一天


下一篇:Django(静态文件or路由)