NSURLConnection+RACSupport.h 893 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // NSURLConnection+RACSupport.h
  3. // ReactiveObjC
  4. //
  5. // Created by Justin Spahr-Summers on 2013-10-01.
  6. // Copyright (c) 2013 GitHub, Inc. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @class RACTwoTuple<__covariant First, __covariant Second>;
  10. @class RACSignal<__covariant ValueType>;
  11. NS_ASSUME_NONNULL_BEGIN
  12. @interface NSURLConnection (RACSupport)
  13. /// Lazily loads data for the given request in the background.
  14. ///
  15. /// request - The URL request to load. This must not be nil.
  16. ///
  17. /// Returns a signal which will begin loading the request upon each subscription,
  18. /// then send a tuple of the received response and downloaded data, and complete
  19. /// on a background thread. If any errors occur, the returned signal will error
  20. /// out.
  21. + (RACSignal<RACTwoTuple<NSURLResponse *, NSData *> *> *)rac_sendAsynchronousRequest:(NSURLRequest *)request;
  22. @end
  23. NS_ASSUME_NONNULL_END