-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
SwiftUI Essentials - iOS Edition
By :
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.
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.
An array is a data type designed specifically to hold multiple values in a single ordered collection. An array, for example, could be created to store a list of String values. Strictly speaking, a single Swift based array is only able to store values that are of the same type. An array declared as containing String values, therefore, could not also contain an Int value...
Change the font size
Change margin width
Change background colour