这里的定义是从Swift的书:
A dictionary is a container that stores multiple values of the same type
[…]
They differ from Objective-C’s
NSDictionary
andNSMutableDictionary
classes,which can use any kind of object as their keys and values and do not provide any information about the nature of these objects.
如果是这样,那么我们将如何创建嵌套的字典?
想象一下,我们有一个plist,它包含String,Array和Dictionary项。如果我允许只保持相同的类型的项目(字符串,数组等),那么我将如何使用存储在plist中的不同类型的项目?
如何把不同类型放在同一个字典在Swift?