- Mastering macOS Programming
- Stuart Grimshaw
- 54字
- 2025-04-04 19:10:24
Saying goodbye to i++
So, how do we execute loops in an expressive and concise way without our trusted old i++ syntax? Well, Swift has a few options here, depending on exactly what you want to accomplish:
- for loops iterate over ranges and collections
- while loops run until a condition is no longer met