Inheritance types are supported in Swift

I am assuming only these two types are available in swift, I just want to know that I cannot see them, would your help be appreciated?

  • One

  • Multilevel

+3


source to share


3 answers


See Inheritance in Swift

Watch the video tutorial for this:

Fast inheritance



Another good tutorial on inheritance in swift version:

Quick Mode Inheritance Tutorial

Sample code under Inheritance and Other Topics in Swift

+4


source


Yes in Swift and Objective-c Single and multilevel inheritance supported .



In swift and many other languages, Multiple inheritance is limited to the use of classes due to historical issues such as death diamond and other ambiguities. In the fast one, you can achieve multiple inheritance at some level Protocols

.

+3


source


Only those two are available in swift, but you can implement multiple inheritance. You can use the protocol to achieve the same result as multiple inheritance.

+2


source







All Articles