Swift: Inline include loop not included at the top on PlayGround

I just started playing with Swift. When using the playground, according to the Apple iBook, the following should work:

var firstForLoop = 0;

for i in 1..3 {
    firstForLoop += i;
}

      

However, the interpreter complains: "Using an unresolved identifier" .. "I've tried:

var firstForLoop = 0;

for i in 1...3 {
    firstForLoop += i;
}

      

and it works just fine (including the top value in the loop). Has Apple removed an option ..

from Swift grammar?

+3


source to share


1 answer


..

now ..<

.



You are probably using an older version of the book.

+12


source







All Articles