In Swift, you can prevent the initialization of an object directly by making the initializer private. You can do this with the Factory template.
But if you create an extension, you can provide another initializer and compile it. It doesn't matter if the extension is in the same file or not. This can have serious consequences if your Factory method does some data validation, for example.
Am I missing something in my personal affairs? It seems very bad. Can I prevent this?
struct Foo { let data: Int
source share