Created
March 30, 2016 17:02
-
-
Save Kievkao/1da6f2b33fe8c9f728e8ea9a2cead787 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (NSArray *)arrayFromObjectsCollectedWithBlock:(id(^)(id object))block | |
| { | |
| __block NSMutableArray *collection = [NSMutableArray arrayWithCapacity:[self count]]; | |
| [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { | |
| [collection addObject:block(obj)]; | |
| }]; | |
| return collection; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment