Sean Clark Hess Sean Clark Hess - 11 days ago 5
iOS Question

Alternative Data-Binding library for Objective-C? (like AngularJS)?

Data binding is an awesome abstraction. I use it all the time in AngularJS and it makes apps much simpler. I'm trying to write an iOS app that uses data binding extensively (a game in this case), but KVO is giving me grief. What library implements better data binding for objective-c? Specifically it should:


  • Have weak references, so you don't have to override dealloc

  • Defer firing bindings: if you set the property multiple times in a function, it fires once

  • Defer firing bindings: if you set multiple bound properties in a function, it waits until all are set before firing any (so order doesn't matter)

  • Better syntax: don't stick all the observers together (requiring a big if-else)

  • Better syntax: use blocks?


Answer

Reactive Cocoa looks amazing: https://github.com/blog/1107-reactivecocoa-for-a-better-world

I haven't tried enough to tell if it satisfies #2 and #3, but I hope so.