RACTestObject.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //
  2. // RACTestObject.h
  3. // ReactiveCocoa
  4. //
  5. // Created by Josh Abernathy on 9/18/12.
  6. // Copyright (c) 2012 GitHub, Inc. All rights reserved.
  7. //
  8. #import <CoreGraphics/CoreGraphics.h>
  9. #import <Foundation/Foundation.h>
  10. typedef struct {
  11. long long integerField;
  12. double doubleField;
  13. } RACTestStruct;
  14. @protocol RACTestProtocol <NSObject>
  15. @optional
  16. - (void)optionalProtocolMethodWithObjectValue:(id)objectValue;
  17. @end
  18. @interface RACTestObject : NSObject <RACTestProtocol>
  19. @property (nonatomic, strong) id objectValue;
  20. @property (nonatomic, strong) id secondObjectValue;
  21. @property (nonatomic, strong) RACTestObject *strongTestObjectValue;
  22. @property (nonatomic, weak) RACTestObject *weakTestObjectValue;
  23. @property (nonatomic, weak) id<RACTestProtocol> weakObjectWithProtocol;
  24. @property (nonatomic, assign) NSInteger integerValue;
  25. // Holds a copy of the string.
  26. @property (nonatomic, assign) char *charPointerValue;
  27. // Holds a copy of the string.
  28. @property (nonatomic, assign) const char *constCharPointerValue;
  29. @property (nonatomic, assign) CGRect rectValue;
  30. @property (nonatomic, assign) CGSize sizeValue;
  31. @property (nonatomic, assign) CGPoint pointValue;
  32. @property (nonatomic, assign) NSRange rangeValue;
  33. @property (nonatomic, assign) RACTestStruct structValue;
  34. @property (nonatomic, assign) _Bool c99BoolValue;
  35. @property (nonatomic, copy) NSString *stringValue;
  36. @property (nonatomic, copy) NSArray *arrayValue;
  37. @property (nonatomic, copy) NSSet *setValue;
  38. @property (nonatomic, copy) NSOrderedSet *orderedSetValue;
  39. @property (nonatomic, strong) id slowObjectValue;
  40. // Returns a new object each time, with the integerValue set to 42.
  41. @property (nonatomic, copy, readonly) RACTestObject *dynamicObjectProperty;
  42. // Returns a new object each time, with the integerValue set to 42.
  43. - (RACTestObject *)dynamicObjectMethod;
  44. // Whether to allow -setNilValueForKey: to be invoked without throwing an
  45. // exception.
  46. @property (nonatomic, assign) BOOL catchSetNilValueForKey;
  47. // Has -setObjectValue:andIntegerValue: been called?
  48. @property (nonatomic, assign) BOOL hasInvokedSetObjectValueAndIntegerValue;
  49. // Has -setObjectValue:andSecondObjectValue: been called?
  50. @property (nonatomic, assign) BOOL hasInvokedSetObjectValueAndSecondObjectValue;
  51. - (void)setObjectValue:(id)objectValue andIntegerValue:(NSInteger)integerValue;
  52. - (void)setObjectValue:(id)objectValue andSecondObjectValue:(id)secondObjectValue;
  53. // Returns a string of the form "objectValue: integerValue".
  54. - (NSString *)combineObjectValue:(id)objectValue andIntegerValue:(NSInteger)integerValue;
  55. - (NSString *)combineObjectValue:(id)objectValue andSecondObjectValue:(id)secondObjectValue;
  56. - (void)lifeIsGood:(id)sender;
  57. + (void)lifeIsGood:(id)sender;
  58. - (NSRange)returnRangeValueWithObjectValue:(id)objectValue andIntegerValue:(NSInteger)integerValue;
  59. // Writes 5 to the int pointed to by intPointer.
  60. - (void)write5ToIntPointer:(int *)intPointer;
  61. - (NSInteger)doubleInteger:(NSInteger)integer;
  62. - (char *)doubleString:(char *)string;
  63. - (const char *)doubleConstString:(const char *)string;
  64. - (RACTestStruct)doubleStruct:(RACTestStruct)testStruct;
  65. - (dispatch_block_t)wrapBlock:(dispatch_block_t)block;
  66. @end