Reputation: 1385
I want to create something like this in Swift
NSArray *array =
[[NSArray alloc] initWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:@"Xcode",@"IDE",@"iOS",@"language", nil],
[NSDictionary dictionaryWithObjectsAndKeys:@"Eclipse",@"IDE",@"Java",@"language", nil]
,nil];
I surfed around and also referred https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html#//apple_ref/doc/uid/TP40014097-CH5-XID_399
but no luck. Can anyone please help?
Thanks in advance.
Upvotes: 1
Views: 3809
Reputation: 1286
Easy as can be
let array = [["IDE": "Xcode", "language": "iOS"], ["IDE": "Eclipse", "language": "Java"]]
PlayGround snap :
Upvotes: 8