RACSubscriber+AFProgressCallbacks.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // RACSubscriber+AFProgressCallbacks.h
  3. // Reactive AFNetworking Example
  4. //
  5. // Created by Robert Widmann on 3/28/13.
  6. // Copyright (c) 2013 CodaFi. All rights reserved.
  7. //
  8. #ifdef RAFN_EXPERIMENTAL_PROGRESS_SUPPORT
  9. #import <ReactiveObjC/ReactiveObjC.h>
  10. @interface RACSubscriber (AFProgressCallbacks)
  11. + (instancetype)subscriberWithNext:(void (^)(id x))next progress:(void (^)(float progress))progress error:(void (^)(NSError *error))error completed:(void (^)(void))completed;
  12. - (void)sendProgress:(float)p;
  13. @end
  14. @interface RACSignal (RAFNProgressSubscriptions)
  15. // Convenience method to subscribe to the `progress` and `next` events.
  16. - (RACDisposable *)subscribeProgress:(void (^)(float progress))progress next:(void (^)(id x))nextBlock ;
  17. // Convenience method to subscribe to the `progress`, `next` and `completed` events.
  18. - (RACDisposable *)subscribeProgress:(void (^)(float progress))progress next:(void (^)(id x))nextBlock completed:(void (^)(void))completedBlock;
  19. // Convenience method to subscribe to the `progress`, `next`, `completed`, and `error` events.
  20. - (RACDisposable *)subscribeProgress:(void (^)(float progress))progress next:(void (^)(id x))nextBlock error:(void (^)(NSError *error))errorBlock completed:(void (^)(void))completedBlock;
  21. - (RACDisposable *)subscribeProgress:(void (^)(float progress))progress completed:(void (^)(void))completedBlock;
  22. // Convenience method to subscribe to `progress`, `next` and `error` events.
  23. - (RACDisposable *)subscribeProgress:(void (^)(float progress))progress next:(void (^)(id x))nextBlock error:(void (^)(NSError *error))errorBlock;
  24. // Convenience method to subscribe to `progress`, `error` and `completed` events.
  25. - (RACDisposable *)subscribeProgress:(void (^)(float progress))progress error:(void (^)(NSError *error))errorBlock completed:(void (^)(void))completedBlock;
  26. @end
  27. @interface RACSubject (RAFNProgressSending)
  28. - (void)sendProgress:(float)value;
  29. @end
  30. #endif