PageRenderTime 12ms CodeModel.GetById 9ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/BlocksKit/NSMutableSet+BlocksKit.h

http://github.com/zwaldowski/BlocksKit
C++ Header | 50 lines | 6 code | 6 blank | 38 comment | 0 complexity | fe4ae1745350bc04d2dfab2bf323e8b5 MD5 | raw file
 1//
 2//  NSMutableSet+BlocksKit.h
 3//  %PROJECT
 4//
 5
 6#import "BKGlobals.h"
 7
 8/** Block extensions for NSMutableSet.
 9 
10 These utilities expound upon the BlocksKit additions
11 to the immutable superclass by allowing certain utilities
12 to work on an instance of the mutable class, saving memory
13 by not creating an immutable copy of the results.
14 
15 Includes code by the following:
16 
17 - Martin Sch?rrer.  <https://github.com/MSch>.	 2011. MIT.
18 - Zach Waldowski. <https://github.com/zwaldowski>. 2011. MIT.
19 
20 @see NSSet(BlocksKit)
21 */
22@interface NSMutableSet (BlocksKit)
23
24/** Filters a mutable set to the objects matching the block.
25 
26 @param block A single-argument, BOOL-returning code block.
27 @see reject:
28 */
29- (void)performSelect:(BKValidationBlock)block;
30
31/** Filters a mutable set to all objects but the ones matching the block,
32 the logical inverse to select:.
33 
34 @param block A single-argument, BOOL-returning code block.
35 @see select:
36 */
37- (void)performReject:(BKValidationBlock)block;
38
39/** Transform the objects in the set to the results of the block.
40 
41 This is sometimes referred to as a transform, mutating one of each object:
42	[controllers map:^id(id obj) {
43	  return [obj view];
44	}];
45 
46 @param block A single-argument, object-returning code block.
47 */
48- (void)performMap:(BKTransformBlock)block;
49
50@end