Basics: Tuples
Are particularly useful as the return values of functions.
Are useful for temporary groups of related values.
Let http404Error = (404, "Not Found")
// http404Error is of type (Int, String), and equals (404, "Not Found") Let (statusCode, statusMessage) = http404Error
print("The status code is \(statusCode)")
// Prints "The status code is 404"
print("The status message is \(statusMessage)")
// Prints "The status message is Not Found" Let (justTheStatusCode, _) = http404Error
print("The status code is \(justTheStatusCode)")
// Prints "The status code is 404" let http200Status = (statusCode: 200, description: "OK")
Print("The status code is \(http404Error.0)")
// Prints "The status code is 404"
print("The status message is \(http404Error.1)")
// Prints "The status message is Not Found"
Semantic portal