C-Style i++ for is deprecated in swift issue
<p>I want to increment <strong>index</strong> at some point for this loop it prints 1,3,5 which is i want to. I get the warning</p>
<h2>C-Style for statement is deprecated and ...</h2>
<p>i know what it means.</p>
<pre><code>for var index=0; index&lt;5; index++ {
    //If condition A == true
    index++
    //else without index++
    print(index) // print 1, 3, 5
}
</code></pre>
<p>So i changed it to:</p>
<pre><code>for var index in 0..&lt;5 {
    //If condition A == true
    index += 1
    //else without index++
    print(index) // print 1,2,3,4,5 Should 1,3,5 from my side
}
</code></pre>
<p>I just wondering why index not mutable? Even though i have set it to <code>var</code> or any solutions for my issue.</p>