RACBlockTrampoline.h 946 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // RACBlockTrampoline.h
  3. // ReactiveObjC
  4. //
  5. // Created by Josh Abernathy on 10/21/12.
  6. // Copyright (c) 2012 GitHub, Inc. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @class RACTuple;
  10. // A private class that allows a limited type of dynamic block invocation.
  11. @interface RACBlockTrampoline : NSObject
  12. // Invokes the given block with the given arguments. All of the block's
  13. // argument types must be objects and it must be typed to return an object.
  14. //
  15. // At this time, it only supports blocks that take up to 15 arguments. Any more
  16. // is just cray.
  17. //
  18. // block - The block to invoke. Must accept as many arguments as are given in
  19. // the arguments array. Cannot be nil.
  20. // arguments - The arguments with which to invoke the block. `RACTupleNil`s will
  21. // be passed as nils.
  22. //
  23. // Returns the return value of invoking the block.
  24. + (id)invokeBlock:(id)block withArguments:(RACTuple *)arguments;
  25. @end