/BlocksKit/NSMutableDictionary+BlocksKit.h

http://github.com/zwaldowski/BlocksKit · C Header · 46 lines · 6 code · 6 blank · 34 comment · 0 complexity · ca4b8f6fa70f6d4a5a2935a666d2ba74 MD5 · raw file

  1. //
  2. // NSMutableDictionary+BlocksKit.h
  3. // %PROJECT
  4. //
  5. #import "BKGlobals.h"
  6. /** Block extensions for NSMutableDictionary.
  7. These utilities expound upon the BlocksKit additions
  8. to the immutable superclass by allowing certain utilities
  9. to work on an instance of the mutable class, saving memory
  10. by not creating an immutable copy of the results.
  11. Includes code by the following:
  12. - Martin Sch?rrer. <https://github.com/MSch>. 2011. MIT.
  13. - Zach Waldowski. <https://github.com/zwaldowski>. 2011. MIT.
  14. @see NSDictionary(BlocksKit)
  15. */
  16. @interface NSMutableDictionary (BlocksKit)
  17. /** Filters a mutable dictionary to the key/value pairs matching the block.
  18. @param block A BOOL-returning code block for a key/value pair.
  19. @see reject:
  20. */
  21. - (void)performSelect:(BKKeyValueValidationBlock)block;
  22. /** Filters a mutable dictionary to the key/value pairs not matching the block,
  23. the logical inverse to select:.
  24. @param block A BOOL-returning code block for a key/value pair.
  25. @see select:
  26. */
  27. - (void)performReject:(BKKeyValueValidationBlock)block;
  28. /** Transform each value of the dictionary to a new value, as returned by the
  29. block.
  30. @param block A block that returns a new value for a given key/value pair.
  31. */
  32. - (void)performMap:(BKKeyValueTransformBlock)block;
  33. @end