14. Working with Array and Dictionary Collections in Swift
Arrays and dictionaries in Swift are objects that contain collections of other objects. In this chapter, we will cover some of the basics of working with arrays and dictionaries in Swift.
14.1 Mutable and Immutable Collections
Collections in Swift come in mutable and immutable forms. The contents of immutable collection instances cannot be changed after the object has been initialized. To make a collection immutable, assign it to a constant when it is created. Collections are mutable, on the other hand, if assigned to a variable.
14.2 Swift Array Initialization
An array is a data type designed specifically to hold multiple values in a single ordered collection. An array, for example, ...
Get SwiftUI Essentials – iOS 14 Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.