iOS, Mobility

Swift For-Loops

In Swift 3.0 C-style for-loops will be removed. This will force developers to use a swift syntax for for-loops. So lets begin with swift for loops : Looping n times [code language="objc"] // output is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 for i in 0..<10 { print(i) } // or for i in 0...9 { print(i) } [/code] Looping n...

by Ashu Baweja
Tag: loops
10-Jul-2016