|< How are tuples different from arrays in Swift?||Why does Swift have dictionaries as well as arrays? >|
Because arrays, sets, and tuples work in slightly different ways, it’s important to make sure you choose the right one so your data is stored correctly and efficiently.
Remember: arrays keep the order and can have duplicates, sets are unordered and can’t have duplicates, and tuples have fixed values of fixed types inside them.
SPONSORED Announcing NSSpain 2020: Remote Edition! An online, continuous conference for iOS developers. We’ll start on Thursday and finish on Friday, with talks, activities, and lots of fun for 36 hours, non-stop. Sound good? Join us!
Link copied to your pasteboard.