iOS ● ○ ○ Swift 6

Kodebits Day 37: Tuple Destructuring

Jun 8 2026
Practice tuples with a short swift challenge.

What does this print?

let pair = (8, "Hi")
let (num, txt) = pair
print(num)
print(txt)


Try it in the online Swift Playground →

[spoiler title="Solution"]

Answer:

8
Hi

Explanation:

Tuple destructuring unpacks multiple values into separate variables in one statement.

[/spoiler]


Further Reading