Is it possible in Swift to forbid the use of the original class name in my program after the creation of a typealias?
Hi,
To avoid inconsistent use of class name in my program I would like to force the systematic use of the alias name instead of the original class name in my program. Is it possible to do that?
I am using an external library, in which there is a class that does not exactly what it is supposed to do: the name of that class in the library seems incorrect to me. How can I handle this?
eg. a class Dog that has a function meows instead of barks, and I want to rename it Cat and then call exclusively Cat in my program.
Applying a consistent style like this is the job of a linter, not the compiler. For swiftlint, you'd write a rule something along these lines. (This is untested, but based on the
pirates_beat_ninjasexample from the documentation.)