I trying to understand class hierarchy. What are the sub classes of NSObject
. Is there any graphical representation of the hierarchy?
NSObject -> UIResponder ->UIView -> UiControl ->UIButton.
The Foundation Kit, or just Foundation for short, is an Objective-C framework in the OpenStep specification. It provides basic classes such as wrapper classes and data structure classes. This framework uses the prefix NS (for NeXTSTEP). It is also part of Cocoa and of the Swift standard library.
You don't have to inherit from NSObject in Swift, but you did in Objective-C and in fact there are some behaviors you can only have if you do inherit from it. More on that in project 12, but for now just make sure you inherit from NSObject .
This protocol is imported into Swift with the name NSObjectProtocol . An object that conforms to this protocol can be considered a first-class object. Such an object can be asked about its: Class, and the place of its class in the inheritance hierarchy.
You can explore the hierarchy in the hierarchical view of the Symbols navigator in a Xcode project. Be sure to de-select the document icon below to display all symbols and not just those defined in your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With