Skip to content

Some additions to NSObject that make enumerables more pleasant to work with.

Notifications You must be signed in to change notification settings

mbrandonw/OPEnumerable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OPEnumerable

This defines some methods on NSObject that are applicable only to objects conforming to the NSFastEnumeration protocol. These methods are very similar to the ones defined in Ruby's Enumerable module, and fully blocked based. For example, to select a subarray one can do:

NSArray *a = @[ @1, @1, @2, @3, @5, @8 ];
[a select:^(id obj){
  return [obj compare:@4] == NSOrderedAscending;
}];
//=> @[ @1, @1, @2, @3 ]

Another project doing something similar is BlocksKit, but the usage of A2DynamicDelegate scares the crap out of me, so I decided to re-implement most of the methods more directly, and more simply.

##Installation

We love CocoaPods, so we recommend you use it.

##Author

Brandon Williams
brandon@opetopic.com
@mbrandonw
www.opetopic.com

About

Some additions to NSObject that make enumerables more pleasant to work with.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages