Root class of all classes in Swift? [duplicate]

三世轮回 提交于 2020-01-06 05:53:24

问题


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 {
....
} 

回答1:


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? :)



来源:https://stackoverflow.com/questions/45732922/root-class-of-all-classes-in-swift

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!