UIAlertView+RACSignalSupport.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // UIAlertView+RACSignalSupport.h
  3. // ReactiveCocoa
  4. //
  5. // Created by Henrik Hodne on 6/16/13.
  6. // Copyright (c) 2013 GitHub, Inc. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @class RACDelegateProxy;
  10. @class RACSignal;
  11. @interface UIAlertView (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 button clicks on 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 considered
  21. /// undefined behavior.
  22. ///
  23. /// Note that this signal will not send a value when the alert is dismissed
  24. /// programatically.
  25. ///
  26. /// Returns a signal which will send the index of the specific button clicked.
  27. /// The signal will complete itself when the receiver is deallocated.
  28. - (RACSignal *)rac_buttonClickedSignal;
  29. /// Creates a signal for dismissal of the receiver.
  30. ///
  31. /// When this method is invoked, the `rac_delegateProxy` will become the
  32. /// receiver's delegate. Any previous delegate will become the -[RACDelegateProxy
  33. /// rac_proxiedDelegate], so that it receives any messages that the proxy doesn't
  34. /// know how to handle. Setting the receiver's `delegate` afterward is considered
  35. /// undefined behavior.
  36. ///
  37. /// Returns a signal which will send the index of the button associated with the
  38. /// dismissal. The signal will complete itself when the receiver is deallocated.
  39. - (RACSignal *)rac_willDismissSignal;
  40. @end