Skip to content

syntax to use instead of c-style for loop #138

@icanzilb

Description

@icanzilb

c-style for loops are getting sacked in Swift 3 and it's a good idea to comply as soon as possible.

swift collection types actually provide a list of their indexes no matter of the index type so I say we should use those across tutorials and books. E.g:

not preferred:
for var i=0;i<items.count;i++ { ..items[i]... }

preferred:
for i in items.indices { ... items[i] ... }

@micpringle ?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions