0
I’m following an iOS course and in the course shows the for
in this way:
for var i = 1; i <= 10; i++ {
}
But I have an error message, has it changed? How could this be done in the new way?
error: Creatureloop.playground:6:1: error: C-style for statement has been Removed in Swift 3
It has. That’s one
for
that came from C. The IDE is saying that you have a better way to do it and that you should follow the language with its syntax. https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/ControlFlow.html– Diogo Aleixo