For in loop in swift with dynamic range
<p>In swift, I always used the C notation like: </p>

<pre><code>for (var i=0;i&lt;mybuffer.count;i++) {}
</code></pre>

<p>Now in 3.0 this can not be used. 
The problem is that using</p>

<pre><code>for i in..&lt;mybuffer.count {} 
</code></pre>

<p>will not check the value of mybuffer.count for each iteration, which leads to index out of range, in case the mybuffer.count changes.<br><br>Is there a way to overcome this?<br><br> I could use a while statement, but I guess that there must be a way to have a for in loop with a dynamic range, right?</p>