Is it possible to access the real object/unproxy (not sure what's the right term) a NSProxy object?
I extended a NSView with a property and whenever the property is accessed via the view's animator property (a proxy of the view which uses NSProxy), some of my code isn't behaving correctly. I need to access the real/unproxied view object.
I currently use this workaround to access it:
if self.isProxy(), let view = layer?.delegate as? NSView, view == self {
// use the view without NSProxy
}
This is a horrible, horrible workaround and it only works as I know that my view is using a layer and that the layers delegate is returning the view.
A common use case for proxied objects is to be a facade in front of some IPC mechansim that's talking to an out-of-process service. In the case of CoreAnimation, you're talking to a separate "render server" process.