swift 简单循环

19. December 2015 Swift 0

import Foundation

var arr = [String]()

for index in 0…10{

arr.append(“its\(index)”)

}

var arry = []

for index in 1…100{

println(index);

}

for value in arr{

println(value)

}

var dict = [“name”:”lijian”,”age”:”18″]

for (key,value) in dict{

println(“\(key)\(value)”)

}


Leave a Reply

Your email address will not be published. Required fields are marked *