UIAlertView+RACSignalSupport.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // UIAlertView+RACSignalSupport.h
  3. // ReactiveObjC
  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<__covariant ValueType>;
  11. NS_ASSUME_NONNULL_BEGIN
  12. @interface UIAlertView (RACSignalSupport)
  13. /// A delegate proxy which will be set as the receiver's delegate when any of the
  14. /// methods in this category are used.
  15. @property (nonatomic, strong, readonly) RACDelegateProxy *rac_delegateProxy;
  16. /// Creates a signal for button clicks on the receiver.
  17. ///
  18. /// When this method is invoked, the `rac_delegateProxy` will become the
  19. /// receiver's delegate. Any previous delegate will become the -[RACDelegateProxy
  20. /// rac_proxiedDelegate], so that it receives any messages that the proxy doesn't
  21. /// know how to handle. Setting the receiver's `delegate` afterward is considered
  22. /// undefined behavior.
  23. ///
  24. /// Note that this signal will not send a value when the alert is dismissed
  25. /// programatically.
  26. ///
  27. /// Returns a signal which will send the index of the specific button clicked.
  28. /// The signal will complete itself when the receiver is deallocated.
  29. - (RACSignal<NSNumber *> *)rac_buttonClickedSignal;
  30. /// Creates a signal for dismissal of the receiver.
  31. ///
  32. /// When this method is invoked, the `rac_delegateProxy` will become the
  33. /// receiver's delegate. Any previous delegate will become the -[RACDelegateProxy
  34. /// rac_proxiedDelegate], so that it receives any messages that the proxy doesn't
  35. /// know how to handle. Setting the receiver's `delegate` afterward is considered
  36. /// undefined behavior.
  37. ///
  38. /// Returns a signal which will send the index of the button associated with the
  39. /// dismissal. The signal will complete itself when the receiver is deallocated.
  40. - (RACSignal<NSNumber *> *)rac_willDismissSignal;
  41. @end
  42. NS_ASSUME_NONNULL_END