For Loop-Traditional*for parentheses can be omitted*You can only use BOOL as a conditional statement*If only the curly braces for the after of the instruction for ' cannot ' be omitted*the three arguments after the for can be omitted, and if the loop hold statement is omitted, the default is True for(var i =0; I <Ten; i++) {print (i)} forvar i =0; I <Ten; i++{print (i)}for loop-Swift* Closed interval: Contains all values within the range a...b for example:1...5* Half closed interval: Contains the head does not contain the tail a. <b For example:1.. <5other wording* Swift1.0 Version wording0..Ten forIinch 0.. <Ten{print (i)}//: While loop, evaluates whether the condition matches at the beginning of the loopvar count =0 whileCount <Ten{print (count) Count++}count=0print (count)//: Repeat-while, calculates whether the condition meets at the end of the loopRepeat {print (count) Count++} whileCount <Tenprint (count)
Swift learns-----loops