相关疑难解决方法(0)

如何将项目词典添加到另一个词典中

Swift中的数组支持+ =运算符,将一个数组的内容添加到另一个数组.有没有一种简单的方法来为字典做到这一点?

例如:

var dict1 = ["a" : "foo"]
var dict2 = ["b" : "bar"]

var combinedDict = ... (some way of combining dict1 & dict2 without looping)
Run Code Online (Sandbox Code Playgroud)

dictionary swift

165
推荐指数
17
解决办法
10万
查看次数

标签 统计

dictionary ×1

swift ×1