-
Notifications
You must be signed in to change notification settings - Fork 1
/
NSArray+BPFoundationExtensions.h
46 lines (35 loc) · 1.39 KB
/
NSArray+BPFoundationExtensions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// NSArray+BPFoundationExtensions.h
// BPFoundation
//
// Created by Jon Olson on 7/9/09.
// Copyright 2009 Ballistic Pigeon, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSArray (BPFoundationExtensions)
#if NS_BLOCKS_AVAILABLE
- (NSArray *)map:(id (^)(id))block;
- (NSArray *)select:(BOOL (^)(id))block;
- (NSArray *)reject:(BOOL (^)(id))block;
- (id)reduce:(id (^)(id, id))block withInitialValue:(id)value;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
- (NSArray *)mapConcurrent:(id (^)(id))block;
- (NSArray *)selectConcurrent:(BOOL (^)(id))block;
- (NSArray *)rejectConcurrent:(BOOL (^)(id))block;
#endif
- (NSArray *)sort:(NSComparisonResult (^)(id, id))comparator;
#endif
- (NSArray *)reversedArray;
- (NSArray *)shuffledArray;
- (NSArray *)sortedArray;
- (NSArray *)flattenedArray;
- (NSArray *)mapSelector:(SEL)selector;
- (NSArray *)mapSelector:(SEL)selector withArgument:(id)argument;
- (NSArray *)mapSelector:(SEL)selector withArgument:(id)argument withArgument:(id)secondArgument;
#if NS_BLOCKS_AVAILABLE
- (NSDictionary *)dictionaryByApplyingBlock:(id (^)(id))block;
#endif
- (NSDictionary *)dictionaryByApplyingSelector:(SEL)selector;
- (NSDictionary *)dictionaryByApplyingSelector:(SEL)selector withArgument:(id)argument;
- (NSDictionary *)dictionaryByApplyingSelector:(SEL)selector withArgument:(id)argument withArgument:(id)secondArgument;
@end