I'm learning Swift, and I can see Dictionary
in it.
But there are lots of examples that are using NSDictionary
with Swift.
What's the difference between these two?
I want to use an array with index in Swift like an array in PHP.
Which one is better to use?
Dictionary is a native Swift struct. NSDictionary is a Cocoa class. They are bridged to one another (within the usual limits), as the docs explain very clearly and fully.
It's exactly parallel to Array and NSArray.