Get Updates By E-mail 

Article Written By:
Johann Dowa

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.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments