mirror of
https://github.com/status-im/react-native-fs.git
synced 2025-03-01 07:20:33 +00:00
17 lines
382 B
Mathematica
17 lines
382 B
Mathematica
|
//
|
||
|
// NSArray+Map.m
|
||
|
// RNFS
|
||
|
|
||
|
#import "NSArray+Map.h"
|
||
|
|
||
|
@implementation NSArray (Map)
|
||
|
|
||
|
- (NSArray *)mapObjectsUsingBlock:(id (^)(id obj, NSUInteger idx))block {
|
||
|
NSMutableArray *result = [NSMutableArray arrayWithCapacity:[self count]];
|
||
|
[self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||
|
[result addObject:block(obj, idx)];
|
||
|
}];
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
@end
|