Tuple in Swift

This post was originally posted at https://agrawalsuneet.github.io/blogs/tuple-in-swift/ and reposted on Medium on 21th May 2021.

The answer is NO.

  1. Unnamed variables
  2. Named variables

And how do I use it?

  1. Unnamed variables
  2. Named variables

Unnamed variables Tuple

var tuple = ("Suneet", "Agrawal")print(tuple.0)
print(tuple.1)

Named variables Tuple

var tuple = (firstName : "Suneet", lastName : "Agrawal")print(tuple.firstName)
print(tuple.lastName)

Please continue reading at https://agrawalsuneet.github.io/blogs/tuple-in-swift/

--

--

https://agrawalsuneet.github.io/

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store