NSURLConnection+RACSupport.h 829 B

12345678910111213141516171819202122232425262728293031
  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 RACTuple;
  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 `RACTuple` of the received `NSURLResponse` and downloaded
  19. // `NSData`, and complete on a background thread. If any errors occur, the
  20. // returned signal will error out.
  21. + (RACSignal<RACTuple *> *)rac_sendAsynchronousRequest:(NSURLRequest *)request;
  22. @end
  23. NS_ASSUME_NONNULL_END