1
votes

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.

1

1 Answers

8
votes

Easy as can be

let array = [["IDE": "Xcode", "language": "iOS"], ["IDE": "Eclipse", "language": "Java"]]

PlayGround snap :PlayGround snap