To create a tuple, just put it in normal brackets and separate it with a coma, you can also do this by the return function Example:
let exampleTuple = (23, "A string", 5.583)
Apple article:
Tuples group multiple values ββinto one composite value. The values ββinside the tuple can be of any type and should not be of one type, like the others. In this example (404, "Not Found") is a tuple that describes the HTTP status code. The HTTP status code is a special value returned by the web server whenever you request a web page. The 404 Not Found status code is returned if you request a web page that does not exist.
let http404Error = (404, "Not Found")
source share