let dic = ["apple" : "苹果","bag" : "包"]
for (key,value) in dic
{
print("键值对==\(key) : \(value)")
}
print("------------->")
print(dic.keys)
print("------------->")
print(dic.values)
for key in dic.keys
{
print("key==\(key)")
}
for value in dic.values
{
print("value==\(value)")
}
原文链接:https://www.f2er.com/swift/322486.html