9 Arrays
An important task in programming is to group together logically related values. For example, imagine your application keeps lists of a user’s friends, favorite books, travel locations, and so on. It is often necessary to be able to keep those values together and pass them around your code. Collections make these operations convenient.
Swift has a number of collection types. The first we will cover is called an Array.
Arrays are an ordered collection of values. Each position in an array is identified by an index, and any value can appear multiple times in an array. Arrays are typically used when the order of the values is important or useful to know, but it is not a prerequisite that the order of the values be meaningful. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access