Your Swift Classes Should Be Final

Make then final!

Steven Curtis
2 min readApr 26, 2022
Photo by George Kroeker on Unsplash

I’ve previously written about favouring composition over inheritance when coding in Swift.

I can even pull in my own definition of inheritance here:

Inheritance: A fundamental OO concept that enables new objects to take on the properties of existing objects. A class that inherits from a superclass is called a subclass or derived class.

So generally we don’t favour using inheritance when coding in Swift.

So what is the issue?

I remember that article! The basic point of that article was we should be implementing the SOLID principles while coding in Swift.

When we’re working in a team though, you can’t guarantee that your colleagues are going to follow all of that

--

--

Responses (1)