Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Root class of all classes in Swift? [duplicate]

Tags:

class

swift

The Apple's developer documentation says:

NSObject is The root class of most Objective-C class hierarchies, from which subclasses inherit a basic interface to the runtime system.

I wonder what is the root class of all classes in Swift in the example below:

class MyClass {
....
} 
like image 370
T D Nguyen Avatar asked Oct 21 '25 14:10

T D Nguyen


1 Answers

Swift classes do not inherit from a universal base class. Classes you define without specifying a superclass automatically become base classes for you to build upon.

https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Inheritance.html

Is that what you were looking for? :)

like image 150
André Slotta Avatar answered Oct 24 '25 06:10

André Slotta