sonics876
sonics876

Reputation: 957

Swift non Inclusive Range with Double Dot

for i in 0..100 {
    println("\(i)")
}

I different types of errors depending on the location of the statements:

Upvotes: 11

Views: 7282

Answers (1)

Anthony Kong
Anthony Kong

Reputation: 40664

The half-closed range operator has been changed to '..<' since Xcode beta 3. See release doc here https://developer.apple.com/swift/blog/?id=3

The error message will disappear if you do this:

for i in 0..<100 {
    println("\(i)")
}

Upvotes: 28

Related Questions