Collections let you store and organize multiple values. Swift provides three primary collection types: arrays (ordered lists), dictionaries (key-value pairs), and sets (unique unordered values). Each has different performance characteristics that determine when to use which.
Figure 1 — The three primary Swift collection types: arrays preserve insertion order and allow duplicates, dictionaries store key-value pairs with O(1) lookup, and sets enforce unique values with fast membership testing.
Arrays
An array stores values of the same type in an ordered list:
var fruits = ["Apple", "Banana", "Cherry"]
fruits.append("Date")
print(fruits[0]) // Apple
print(fruits.count) // 4Full content for this chapter will be added in a future update. The complete article covers array operations, dictionaries, sets, performance (Big-O notation), and choosing the right collection type.

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