![](/img/trans.png)
[英]How to access dictionary value by key inside array of dictionary on Swift 3?
[英]How to create Dictionary inside Array structure in Swift?
我想在Swift中創建類似的東西
NSArray *array =
[[NSArray alloc] initWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:@"Xcode",@"IDE",@"iOS",@"language", nil],
[NSDictionary dictionaryWithObjectsAndKeys:@"Eclipse",@"IDE",@"Java",@"language", nil]
,nil];
我四處逛逛,還參考了https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html#//apple_ref/doc/uid/TP40014097-CH5-XID_399
但沒有運氣。 誰能幫忙嗎?
提前致謝。
很容易
let array = [["IDE": "Xcode", "language": "iOS"], ["IDE": "Eclipse", "language": "Java"]]
PlayGround snap:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.