Feedback on my implementation of the Observer pattern with Observable protocol

Hello everyone,

I needed a generic solution to Observe properties. I tried KVO and other implementations of the Observer pattern but I didn't like either solution. KVO is so far from native and random implementations of the Observer pattern are too simple for my needs. I found 1 great implementation of Observable but it was outdated so I created my updated version of it.

I'm a relatively new developer so I'd like to ask for some feedback on the implementation. Is it "Swifty", are there any obvious mistakes and would something like this ever come to the Swift Standard Library. But most importantly, are there any improvements I could make?

You might like to take a look at this article on my blog.

I have also taken this one step further and now use keypaths instead of strings for the "property names"

Wow, this is lengthy post, I'll dive deeper into it, thanks!

The version of NotifyPropertyChanged, with key paths, is in the Cell Presenter article

Terms of Service

Privacy Policy

Cookie Policy