Swift 3: Date vs NSDate?

后端 未结 5 1197
渐次进展
渐次进展 2020-12-01 10:08

What is the difference between the NS and non NS classes? Particularly NSDate vs Date? Does NS represent some type of wrapper around

5条回答
  •  死守一世寂寞
    2020-12-01 10:49

    NS classes are Objective-C classes. As Objective-C is the older programming language for iOS or MacOS applications, Swift allows you to use those classes structs in your code. So you can migrate applications from Objective-C to Swift if you want to.

    The non-NS classes or structs are the Swift equivalents of the the NS classes or structs. You can read more about this issue here or here.

    But be aware: As Objective-C and Swift do are different programming languages, it can happen that NS and non-NS classes are not completely working the same way.

提交回复
热议问题