Friday October 12, 2012

libextobjc - Objective-C Extended

This is one of those freaky cool libraries that is certainly dangerous to pull into your project, but too insightful to ignore. Justin Spahr-Summers has built a well thought-out set of augmentations to the Objective-C runtime called libextobjc. If you’ve done your own calls to class_replaceMethod(), then you should check this out.

He’s got demonstrations of defining properties on categories, compile time checking for key paths, and a slick coroutine implementation. My personal favorite is the simple macro to declare tuples and do multivariable assignment. He abuses the C pre-processor heavily, but has copious documentation and comments. A treasure trove of Objective-C ingenuity.