EBImageRequest Class Reference
Inherits from | EBRequest : NSObject |
Declared in | EBImageRequest.h EBImageRequest.m |
Overview
EBImageRequest fetches images from a URL. It returns UIImage objects in the completionBlock. As usual, the completion block is executed in the main thread so it’s safe to draw once the image is donwloaded inside completionBlock.
See requestWithURL:
Sample usage:
EBImageRequest *imageRequest = [EBImageRequest requestWithURL:_imageURL];
imageRequest.completionBlock = ^(id img) {
UIImage *image = (UIImage *)img;
_imageView.image = image;
}
[_imageRequest start];
By default, EBImageRequest will schedule the internal download with self.runLoopMode = NSRunLoopCommonModes
.
The behavior can be changed by modifying the property imageRequest.runLoopMode
before starting it. The default run loop is NSDefaultRunLoopMode
.
Tasks
-
– initWithURL:
Creates a new request with the specified URL. Not started until start is called.
-
+ requestWithURL:
Creates a new request with the specified URL. Not started until start is called.
-
– start
Starts an asynchronous request
-
– stop
Stops an asynchronous request.
-
– isRunning
Specifies whether the current request is running.
Instance Methods
initWithURL:
Creates a new request with the specified URL. Not started until start is called.
- (id)initWithURL:(NSURL *)url
Parameters
- url
URL for the request.
Discussion
Creates a new request with the specified URL. Not started until start is called.
Declared In
EBRequest.h
isRunning
Specifies whether the current request is running.
- (BOOL)isRunning
Discussion
Specifies whether the current request is running.
Declared In
EBRequest.h