O'Reilly logo

Swift Programming: The Big Nerd Ranch Guide by John Gallagher, Matthew Mathias

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9 Arrays

An important task in programming is to group together logically related values. For example, imagine that 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.

An array is 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required