Swift Programming

Swift Sets

In the previous Swift Arrays article, we learned about creating array that can hold multiple values in an ordered list.

But, if we have to make sure a list can hold a value only once, we use a set in Swift.


What is a set?

Sets is simply a container that can hold multiple value of data type in an unordered list and ensures unique element in the container (i.e each data appears only once).

Pages