4 ms·
Swift allows you to program using “headers” - just have a protocol and an implementation, even in separate files if you want. This is a good pattern for some c
by turdprincess 3y ago
Swift allows you to program using “headers” - just have a protocol and an implementation, even in separate files if you want.
This is a good pattern for some cases, like the public members of a package. However, I love that I don’t need to do this for every class I write.
And if you do use this approach, at least swift will emit a compile error if your protocol and implementation signatures don’t match.
ObjC will happily compile if your header is missing an implementation and crash at runtime.