ios#swift#스위프트#애플#아이폰#반복문

    IOS 스위프트(Swift) 문법 - 반복문

    반복문이란? 반복적으로 코드가 실행되게 만드는 구문을 말합니다. 반복문으로는 for-in, while, repeat-while이 있습니다. /* for 루프상수 in 순회대상 { //실행할 구문.. } */ for i in 1...4 { print(i) //1,2,3,4 } let array = [1,2,3,4,5] for i in array { print(i) //1,2,3,4,5 } /* while 조건식 { //실행할 구문 } */ var number = 5 while number < 10 { number+=1 //6,7,8,9,10 } number //10 /* repeat { //실행할 구문 } while 조건식 */ var x = 6 repeat { x+=2 } while x < 5 print..