title: How to write a non-C-like for-loop in Swift 2.2+?
body: <p>I have updated Xcode (7.3) and there are a lot of changes; C-like for expressions will be deprecated. For a simple example,</p>
  
  <pre><code>for var i = 0;  i &lt;= array.count - 1;  i++
   {
        //something with array[i]
   } 
  </code></pre>
  
  <p>How do I write this clear and simple C-like for-loop to be compliant with the new changes?</p>
  
  <pre><code>for var i = 0, j = 1;  i &lt;= array.count - 2 &amp;&amp; j &lt;= array.count - 1;  i++, j++
  {
       //something with array[i] and array[j]
  }  
  </code></pre>
  
  <p>Update. 
  One more variant</p>
  
  <pre><code>for var i = 0; i &lt;= &lt;array.count - 1; i++
  {
      for var j = i + 1; j &lt;= array.count - 1; j++
      {
          //something with array[i] and array[j]
      }
  }
  </code></pre>
  
  <p>And more ...</p>
  
  <pre><code>for var i = 0, j = 1, g = 2;  i &lt;= array.count - 3 &amp;&amp; j &lt;= array.count - 2 &amp;&amp;   g &lt;= array.count - 1;  i++, j++, g++
  {
       //something with array[i] and array[j] and array[g]
  } 
  </code></pre>
  
  <p><strong>Update2</strong> After several suggestions for me while loop is preferable universal substitution for all cases more complicated than the simple example of C-like for-loop (suitable for for in expression). No need every time to search for new approach.<br>
  For instance: Instead of </p>
  
  <pre><code>for var i = 0; i &lt;= &lt;array.count - 1; i++
  {
      for var j = i + 1; j &lt;= array.count - 1; j++
      {
          //something with array[i] and array[j]
      }
  }
  </code></pre>
  
  <p>I can use</p>
  
  <pre><code>var i = 0
  while i &lt; array.count
  {
      var j = i + 1
      while j &lt; array.count
      {
          //something with array[i] and array[j]
          j += 1
      }
      i += 1
  }
  </code></pre>