Why is inheritance not desirable in swift?



Why is inheritance not desirable in swift?..

Answer / Vipin Prabhakar Singh

Inheritance is not desirable in Swift because it can lead to tightly coupled classes, hidden subclass behavior, and violations of the Single Responsibility Principle. Instead, Swift encourages composition over inheritance.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apple iOS Swift Interview Questions

What is strong in swift?

1 Answers  


What is the difference between swift and objective c?

1 Answers  


How can you add table view?

1 Answers  


What is nested function in swift?

1 Answers  


What are the different floating point numbers in swift?

1 Answers  


What is static in swift?

1 Answers  


What are delegates swift 4?

1 Answers  


What does appdelegate swift do?

1 Answers  


What are the advantages of using swift?

1 Answers  


How you define variables in swift language?

1 Answers  


How can you write multiple line comment?

1 Answers  


Is it worth learning swift 2019?

1 Answers  


Categories