I recorded two insanely great, beautiful, amazing, wonderful (I’ve been watching Steve Jobs’ keynotes recently, it must be rubbing off a bit) feature presentations to explain two cool features in KoboldTouch.
Weak typing allows you to create, read and assign variables just by name. You don’t have to declare the variable, just assign a value. No need to change the interface, and works with all KTModel classes.
Access is almost as fast as property access, and the values are mutable thanks to the KTMutableNumber implementation which feels like NSNumber except that it doesn’t create and release new objects every time you need to change a value.
Controller sharing solves the common problem of getting two unrelated objects to communicate with each other. Of course you need references to do that, but where to put them? Hopefully not in a singleton, or else you open the portal to retain cycle/memory leak hell.
KoboldTouch has an elegant, remarkable, amazing (here it is again) solution for this problem: register any controller by (unique) name on the scene ViewController, and then get the controller back by its name or class. No interface changes needed, no retain cycles (as long as you declare any caching ivar/property referencing that foreign controller as weak).
In this short outtake I struggle to get past a certain word…
|Follow @gaminghorror||Follow @kobold2d|