Search code examples
swiftstaticfinal

static vs final swift


What is the difference between two these words in swift Static you can not inherit from this class as well as the final. When I should use each of them?

Usually people more concern about static and class word in swift, but the difference is that from static you can not inherent.

Thank you everyone


Solution

  • So, after a while research I would say that static is used for a property that can be accessed without created a class instance and final is a modifier for a class that from this class nobody can be inherent.