Categories
Featured iPhone Development Resources iOS Development Libraries Open Source iOS Libraries And Tools

Open Source Library That Enhances Objective-C (Blocks, Protocols, Categories, More)

I’ve mentioned some great libraries that extend features found within the SDK, but few that extend Objective-C itself.

Recently I noticed that a project known as libextobjc from Justin Spahr-Summers has undergone significant updates.

This library enhances core Objective-c functionality enhancing categories, protocols, blocks and more.

Here are some of the features as stated in the readme:

– Safe categories, using EXTSafeCategory, for adding methods to a class without overwriting anything already there (identifying conflicts for you).
– Concrete protocols, using EXTConcreteProtocol, for providing default implementations of the methods in a protocol.
– Simpler and safer key paths, using EXTKeyPathCoding, which automatically checks key paths at compile-time.
– Easier use of weak variables in blocks, using @weakify and @strongify in the EXTScope module.
– Scope-based resource cleanup, using @onExit in the EXTScope module, for automatically cleaning up manually-allocated memory, file handles, locks, etc., at the end of a scope.
– EXTNil, which is like NSNull, but behaves much more closely to actual nil (i.e., doesn’t crash when sent unrecognized messages).
– EXTBlockTarget, which extends the target-action mechanism with support for blocks.

There are a number of other features, but those stated above are the “production ready” features.

You can download the library on Github here.

If you checked out this library in the past or haven’t seen it before it is definitely worth giving a look.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.