Objective-C Additions For Ruby Like Iterators And More

If you’ve been wishing that you could have Ruby’s number objects and iterators in Objective-C here’s an open source set of categories made to do just that.

Marin Usalj has created a set of additions for Objective-C arrays, dictionaries, number objects and sets providing a vast number of convenience methods called Objective-C sugar.

Using Objective-C literals along with the methods included in Objective-C sugar it’s possible to achieve a very concise Ruby like syntax for instance here’s an example from the readme printing the same statement 3 times:

[@3 times:^{
NSLog(@"Hello!");
}];
// Hello!
// Hello!
// Hello!

There’s many other methods in these categories and you can see more on the Github page here and in this blog post.

Some great additions in these categories.

DeliciousTwitterFacebookRedditLinkedInEmail

Original article: Objective-C Additions For Ruby Like Iterators And More

©2012 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *