What is difference between NSDictionary vs Dictionary in Swift?

后端 未结 4 1911
清歌不尽
清歌不尽 2021-02-18 12:52

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

4条回答
  •  面向向阳花
    2021-02-18 13:28

    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.

提交回复
热议问题