Search code examples
objective-cswiftinheritancemultiple-inheritance

Does Objective C & Swift support Hierarchical inheritance?


I know that Objective-C and Swift support multi-level inheritance. But do they support hierarchical inheritance too or is it that any language that supports multi-level inheritance supports hierarchical by default?


Solution

  • Yes, both languages support hierarchical inheritance. There are countless examples in the iOS SDK.

    UIResponder is subclassed by UIApplication, UIView, UIViewController.

    UIView obviously has many subclasses as does UIViewController.