top | item 37949571

(no title)

turdprincess | 2 years 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.

discuss

order

No comments yet.