Extensive Functional Programming Inspired Categories For NSArray, NSSet, And NSDictionary

Early this year I mentioned the release of an Xcode 5 compatible version of the excellent CodePilot was released by Macoscope.

Here is an extensive functional programming inspired library released from Macoscope providing categories for NSArray, NSSet, and NSDictionary providing a clean syntax for many common operations making extensive use of blocks.

These utilities include functionality for searching, sorting, counting, joining, and more.

Here’s an example from the readme showing how one would check an NSArray to see how many elements contain the letter “a”:

NSArray *elements = @[@"Warsaw", @"Berlin", @"London", @"New York", @"Paris"];

NSInteger count = [elements mcs_count:BOOL^(NSString *object) {
    return [object rangeOfString:@"a"].location != NSNotFound;
}];

//result 2

You can read more about MCSCollectionUtility in an article by Rafal Augustyniak over on the Macoscope blog.

You can find MCSCollectionUtility on Github here.

An excellent collection of enhancements for NSArray, NSSet, NSDictionary.

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Extensive Functional Programming Inspired Categories For NSArray, NSSet, And NSDictionary

©2014 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 *