Tuples in Swift 2
Tuples A tuple is a group of zero or more values represented as one value.
For example ("John", "Smith") holds the first and last name of a person. You can access the inner values using the “.” notation followed by the index of the value or you can name the elements from a tuple and use those names to refer to them. An element name is an identifier followed by a colon “:”
var person = (firstName: "John", lastName: "Smith") var firstName = person.firstName // John var lastName = person.lastName // Smith
Don’t forget that a function can return a tuple.
Here a nice post from “We ❤ Swift” about tuples.












