tho I'm not familiar with swift: my guess here is that the first (for ... in) shares a closure / var, so stuff like this classic JS mistake can happen:
for i=0;i<10;i++ { setTimeout(() => console.log(i), 100); }
and you get 10 calls logging "9". (most languages I've touched do this, JS just makes it worse since `var x` in the loop will not fix it)The second won't do that, since the "view" var isn't "mutated" between calls.