Check out example codes for "turning an arrya into a set swift". It will help you in understanding the concepts better.

Code Example 1

let mySet = Set(["a", "b", "a"])  // Set<String>

Learn ReactJs, React Native from akashmittal.com