Tuples
Overview
Tuples enable you to create and pass around groupings of values. You can use a tuple to return multiple values from a function as a single compound value. (Swift.org)
Sample Codes
Example 1
Arrays, Sets, Tuples... When to use which?
Type | Allows Duplicates | Ordered | Multiline String | Can Grow? | Best for |
---|---|---|---|---|---|
Array | Yes | Yes | ? | Yes | Score List by User, |
Set | No | No | ? | ? | Dictionary, |
Tuple | Yes | No? | Yes | No | Forms, |
Sources
Videos
Articles / Documents
Last updated