Why do we ever need to inherit from NSObject?
Not just for Objective-C Programmers
4 min readFeb 13, 2022
You might want to inherit from NSObject. What does that mean, and why would you ever want to?
This article and accompanying video seeks to explain how.
Prerequisites:
- Be able to produce a “Hello, World!” iOS application (guide HERE)
- You will be expected to be aware how to make a Single View Application in Swift, or be able to code in Swift Playgrounds
Terminology
NSObject: The root class of most Objective-C class hierarchies, from which subclasses inherit a basic interface to the runtime system and the ability to behave as Objective-C objects
Objective-C: An Object Oriented language
Subclassing: This is the act of basing a new class on an existing class
NSObject
NSObject
is the root class of most Objective-C
hierarchies, from which subclasses inherit an interface to the…