NSObject+RACDeallocating.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // NSObject+RACDeallocating.h
  3. // ReactiveCocoa
  4. //
  5. // Created by Kazuo Koga on 2013/03/15.
  6. // Copyright (c) 2013 GitHub, Inc. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @class RACCompoundDisposable;
  10. @class RACDisposable;
  11. @class RACSignal;
  12. @interface NSObject (RACDeallocating)
  13. /// The compound disposable which will be disposed of when the receiver is
  14. /// deallocated.
  15. @property (atomic, readonly, strong) RACCompoundDisposable *rac_deallocDisposable;
  16. /// Returns a signal that will complete immediately before the receiver is fully
  17. /// deallocated. If already deallocated when the signal is subscribed to,
  18. /// a `completed` event will be sent immediately.
  19. - (RACSignal *)rac_willDeallocSignal;
  20. @end
  21. @interface NSObject (RACUnavailableDeallocating)
  22. - (RACSignal *)rac_didDeallocSignal __attribute__((unavailable("Use -rac_willDeallocSignal")));
  23. - (void)rac_addDeallocDisposable:(RACDisposable *)disposable __attribute__((unavailable("Add disposables to -rac_deallocDisposable instead")));
  24. @end