Imagine you have a bunch of delicious candies 🍬, about 20-30 items. Normally a person can eat about 2 or 3 candies per day.

To deal easier with a lot of candies, it makes sense to keep them in a single place. And reasonable this place is a plastic bag or a small box, instead of keeping them spread around and messy on the table.

When you want to take the candies from home to work (to delight tedious working hours 😀), you definitely need a bag.
The same happens when dealing with a bunch of similar objects in an application. The comfort of storing and manipulating the objects grouped in a collection makes this structure so advantageous.

#swift #array #set #dictionary literals

Mastering Swift: Tips About Array and Dictionary Literals
1.35 GEEK