We have covered three main Swift standard library collections. There are also other not-so-well-known and often-used helper collections, such as ArraySlice
, MapCollection
, CollectionOfOne
, ContiguousArray
, EmptyCollection
, and FilterCollection
. If you want to know more about them, just press command and click on any type. You will see the content of the Swift standard library. Then, just explore it!
You can also implement your own collections, if needed. The Swift generic allows you to make very abstract collections that can be used with any type. For example, it could be the Stack, or a Linked List, a Binary Tree or any other collection that fits your needs.