• + 0 comments

    for item in items {} is how for cycle is intended for Swift. The block {} will be executed items.count times and 'item' variable will assume each value of 'items' per iteration. In my code I used 'integer' as variable. According to that, int2reverse is initialized with 'integer' that is an int value equals to 'i' at first iteration, i+1, ... j in the last iteration.