[swift-evolution] extension of AnyObject

Kenny Leung kenny_leung at pobox.com
Fri Dec 29 22:21:02 CST 2017


Hi All.

I just discovered that you can’t write an extension on AnyObject. What’s the reasoning behind this?

I’m trying to write my own version of KeyValueObserving, and it would be really nice to be able to write

    self.observe(someObject, keyPath) {
        blah de blah
    }

from anywhere.

Thanks!

-Kenny



More information about the swift-evolution mailing list