If you want to save, for example, an array of strings:
var dict: [String: [String]]
or without syntactic sugar:
var dict: Dictionary<String, Array<String>>
Dictionaries, such as arrays and, in general, everything that uses generics, can handle everything that is a fast type, including tuples, closures, dictionaries, dictionary dictionaries, arrays of dictionaries, etc. - if the conditions for the type type are not specified (for example, the dictionary key can be any type that implements the Hashable protocol), in which case the types must comply with the restrictions.
source share