Swift Tutorial - Tutorialspoint

(backadmin) #1
do...while loop

Like a while statement, except that it tests the condition at the end
of the loop body.

for-in Loop


The for-in loop iterates over collections of items, such as ranges of numbers, items in an
array, or characters in a string:


Syntax


The syntax of a for-in loop in Swift programming language is:


for index in var {
statement(s)
}

Flow Diagram

Free download pdf