A tuple is a combination of two or more values that can be treated as one. If you have ever wished you could return more than one value from a function or method, you should find tuples very interesting.
Bundling variables into tuples
Getting ready
Create a new playground and add the following statement:
import Foundation
This example uses one function from Foundation. We will delve into Foundation in more detail in Chapter 5, Beyond the Standard Library, but for now, we just need to import it.
How to do it...
Let's say that we are building an app that pulls together...