What is tuple? How to create a tuple in swift?



What is tuple? How to create a tuple in swift?..

Answer / Gautam Kumar Seth

A tuple is a data structure that groups multiple values of different types into a single compound value. Tuple in Swift can be created by simply separating the items with commas, for example: let myTuple = (1, "hello", true). To access individual elements, use their position like: myTuple.0, myTuple.1, myTuple.2.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apple iOS Swift Interview Questions

Can enum conform to swift protocol?

1 Answers  


What is category in swift?

1 Answers  


How will you define base class?

1 Answers  


What is block in swift?

1 Answers  


Mention what is the difference between Swift and ‘Objective-C’ language?

1 Answers  


What is @objc in swift?

1 Answers  


What are type methods in swift?

1 Answers  


What are delegates swift 4?

1 Answers  


How long does a swift transfer take?

1 Answers  


What are the tools that are required to develop ios applications?

1 Answers  


Is swift thread safe?

1 Answers  


Mention what are the type of integers does Swift have?

1 Answers  


Categories