Loops, Switch Statements, and Ranges in Swift

iOS 2015. 7. 23. 01:05
반응형

http://www.codingexplorer.com/loops-switch-statements-ranges-swift/



var i: Int

for i = 0; i<10; ++i {

    i

}


i


let count = 3_000_000

count


switch count {

case 2_000_000...4_000_000 :

    println("It was between 2,000,000 and 4,000,000.")

default:

    println(count)

}


반응형

'iOS' 카테고리의 다른 글

[Swift] function 1-2  (0) 2015.07.23
[Swift] function 1-1  (0) 2015.07.23
[swift] card  (0) 2015.07.23
[swift] protocol adjusted class, structure and enum  (0) 2015.07.23
swift create json and parse  (0) 2015.07.21
: