libextobjc icon indicating copy to clipboard operation
libextobjc copied to clipboard

Idea: compile-time validation for type equivalence between two keypaths

Open sibljon opened this issue 12 years ago • 1 comments

@keypath allows for compile-time validation of the existence of a given a keypath. It would also be useful to validate a keypath's type.

The practical application for this is observing one keypath, and once it changes, using its value to set another keypath. For example, I'm working on something now that observes properties of a view controller, and forwards the values of those properties to their respective destinations on the view.

(As an aside, I hate to be that guy that posts feature requests on an open source project, but the README specifically instructed to post ideas like this.)

sibljon avatar Jul 24 '13 18:07 sibljon

I'm a bit biased as one of the contributors, but I would use something like ReactiveCocoa for this. Since it uses KVO and KVC, you can even have slight mismatches in property type and it'll still work as expected.

jspahrsummers avatar Jul 24 '13 18:07 jspahrsummers