Learning SwiftUI - Day 4 of 100
Loops, loops, and more loops.
Again, the basics are the same here. Three stark differences I noticed. There’s no difference in Swift between for
and foreach
loops—it’s just for
loops. Then there’s the delightful _
syntax for when you don’t need to use the variable defined. Lovely.
The second difference was being able to give loops names for nested loop scenarios. Seems genius to me, though I can’t remember the last time I needed a nested loop.
The third difference is in the infinite looping section. Before now, I would have done everything in my power to avoid infinite loops. Interesting. I’ll have to see what comes of this.
Anyway. It was a quick one today.
4 March 2021 100-days-of-swiftui development