Building on the basics from Chapter 5, this chapter covers Swift's more powerful control flow tools: for-in loops, ranges, the versatile switch statement, and pattern matching -- features that make Swift code both concise and expressive.
For-In Loops
The for-in loop is Swift's primary way to iterate over sequences:
for i in 1...5 {
print(i) // Prints 1, 2, 3, 4, 5
}Figure 1 — Switch statement flow: the input value routes to the first matching case, that case's block executes, and either the default case or exhaustiveness ensures every possible value is handled.
Full content for this chapter will be added in a future update. The complete article covers ranges (closed and half-open), for-in with collections, where clauses, switch statements, pattern matching, tuple matching, and labeled statements.

Ultimate iOS Bootcamp: Master Swift & SwiftUI App THE HARD WAY
Ship your apps faster
When you're ready to publish your Swift app to the App Store, Simple App Shipper handles metadata, screenshots, TestFlight, and submissions — all in one place.
Try Simple App Shipper