Get Updates By E-mail 

Article Written By:
Johann Dowa

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.


  •  
  •  
  •  
  •  
  •  

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