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
Here's the deal,
For all intents and purposes, they are the same thing. So long as you import Foundation
, the compiler will know them as the same thing.
As for specific differences, thus Apple doc helps.
Overview
NSObject
is the root class of most Objective-C class hierarchies. Through NSObject
, objects inherit a basic interface to the runtime system and the ability to behave as Objective-C objects.
What that means, in a nutshell, is that NSObjects
are ancient relics from olden (objective c) times.
As for what is better, that is up to you. I find swift objects better than the ns counterpart just for the purpose of keeping code modern, however you may have to use ns objects if you are using code like NSURLCONNECTION
that requires ns objects.
Hope this helps.