UITextView+RACSignalSupport.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // UITextView+RACSignalSupport.h
  3. // ReactiveCocoa
  4. //
  5. // Created by Cody Krieger on 5/18/12.
  6. // Copyright (c) 2012 Cody Krieger. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @class RACDelegateProxy;
  10. @class RACSignal;
  11. @interface UITextView (RACSignalSupport)
  12. /// A delegate proxy which will be set as the receiver's delegate when any of the
  13. /// methods in this category are used.
  14. @property (nonatomic, strong, readonly) RACDelegateProxy *rac_delegateProxy;
  15. /// Creates a signal for the text of the receiver.
  16. ///
  17. /// When this method is invoked, the `rac_delegateProxy` will become the
  18. /// receiver's delegate. Any previous delegate will become the -[RACDelegateProxy
  19. /// rac_proxiedDelegate], so that it receives any messages that the proxy doesn't
  20. /// know how to handle. Setting the receiver's `delegate` afterward is
  21. /// considered undefined behavior.
  22. ///
  23. /// Returns a signal which will send the current text upon subscription, then
  24. /// again whenever the receiver's text is changed. The signal will complete when
  25. /// the receiver is deallocated.
  26. - (RACSignal *)rac_textSignal;
  27. @end
  28. @interface UITextView (RACSignalSupportUnavailable)
  29. - (RACSignal *)rac_signalForDelegateMethod:(SEL)method __attribute__((unavailable("Use -rac_signalForSelector:fromProtocol: instead")));
  30. @end