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

Class Methods

requestWithURL:

Creates a new request with the specified URL. Not started until start is called.

+ (id)requestWithURL:(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

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

start

Starts an asynchronous request

- (BOOL)start

Return Value

YES if the request could be started. NO otherwise.

Discussion

Starts an asynchronous request

Declared In

EBRequest.h

stop

Stops an asynchronous request.

- (void)stop

Discussion

Stops an asynchronous request.

Declared In

EBRequest.h