What’s the correct way to implement default properties when doing default implementation of protocols in Swift?

It’s been a few weeks since I posted this, but I believe what Aaron Brager said is true.

While Protocol-Oriented-Programming is rather new in itself, the idea of protocols has been present in Objective-C for a long time, they are in Swift, and they have their variants in languages such as Java. Due to the nature of protocols and extensions, it looks like doing default implementations of properties is not possible, as extensions won’t allow you to set non-computed properties in them.

Leave a Comment