What is difference between NSDictionary vs Dictionary in Swift?

后端 未结 4 1909
清歌不尽
清歌不尽 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:40

    In practice and with regard to Swift's strong type concept the significant difference is

    • NSDictionary is generally type unspecified
    • Dictionary is supposed to have a specific type.

    Hence native Dictionary is preferable.

提交回复
热议问题