April 2017
Intermediate to advanced
316 pages
9h 33m
English
Swift provides tuples so that they can be used to group multiple values/types into a single compound value. Consider the following example:
let http400Error = (400, "Bad Request") // http400Error is of type (Int, String), and equals (400, "Bad Request") // Decompose a Tuple's content let (requestStatusCode, requestStatusMessage) = http400Error
Tuples can be used as return types in functions to implement multi-return functions as well.
Read now
Unlock full access