Swift 3: subclassification of NSObject or not?

I read several posts, like this one , about the difference between a subclass NSObjectin Swift or just with its own base classwithout a subclass. But they are all a little old, and I do not quite understand this topic.

When should you subclass NSObject? What is the actual difference between a subclass and not a subclass? What is a recommendation in Swift?

+4
source share
2 answers

Apple's NSObject documentation contains the following:

NSObject Objective-C . NSObject Objective-C.

, NSObject , , Objective-C ( , ).

, , NSObject, , , , .. , , ). , , Swift Apple, Swift - , NSObject, . , , NSObject, Objective-C, , API Cocoa ( , UI: , view , ).

, , Objective-C objc_msgSend . Swift , , @objc, , Swift 3, , .

NSObject, Swift , . , , WWDC, , , , . , , , ( - , ).

+9

NSObject . NSObject (AFAIK) NSCoding, .

+1

Source: https://habr.com/ru/post/1657192/


All Articles