Declared in UIButton+WebCache.h
UIButton+WebCache.m

Overview

Integrates SDWebImage async downloading and caching of remote images with UIButtonView.

Tasks

Instance Methods

cancelCurrentImageLoad

Cancel the current download

- (void)cancelCurrentImageLoad

Discussion

Cancel the current download

Declared In

UIButton+WebCache.h

setBackgroundImageWithURL:forState:

Set the backgroundImageView image with an url.

- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state

Parameters

url

The url for the image.

state

The state that uses the specified title. The values are described in UIControlState.

Discussion

Set the backgroundImageView image with an url.

The downloand is asynchronous and cached.

Declared In

UIButton+WebCache.h

setBackgroundImageWithURL:forState:completed:

Set the backgroundImageView image with an url.

- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock

Parameters

url

The url for the image.

state

The state that uses the specified title. The values are described in UIControlState.

success

A block to be executed when the image request succeed This block has no return value and takes the retrieved image as argument.

failure

A block object to be executed when the image request failed. This block has no return value and takes the error object describing the network or parsing error that occurred (may be nil).

Discussion

Set the backgroundImageView image with an url.

The downloand is asynchronous and cached.

Declared In

UIButton+WebCache.h

setBackgroundImageWithURL:forState:placeholderImage:

Set the backgroundImageView image with an url and a placeholder.

- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder

Parameters

url

The url for the image.

state

The state that uses the specified title. The values are described in UIControlState.

placeholder

The image to be set initially, until the image request finishes.

Discussion

Set the backgroundImageView image with an url and a placeholder.

The downloand is asynchronous and cached.

Declared In

UIButton+WebCache.h

setBackgroundImageWithURL:forState:placeholderImage:completed:

Set the backgroundImageView image with an url, placeholder.

- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock

Parameters

url

The url for the image.

state

The state that uses the specified title. The values are described in UIControlState.

placeholder

The image to be set initially, until the image request finishes.

success

A block to be executed when the image request succeed This block has no return value and takes the retrieved image as argument.

failure

A block object to be executed when the image request failed. This block has no return value and takes the error object describing the network or parsing error that occurred (may be nil).

Discussion

Set the backgroundImageView image with an url, placeholder.

The downloand is asynchronous and cached.

Declared In

UIButton+WebCache.h

setBackgroundImageWithURL:forState:placeholderImage:options:

Set the backgroundImageView image with an url, placeholder and custom options.

- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options

Parameters

url

The url for the image.

state

The state that uses the specified title. The values are described in UIControlState.

placeholder

The image to be set initially, until the image request finishes.

options

The options to use when downloading the image. @see SDWebImageOptions for the possible values.

Discussion

Set the backgroundImageView image with an url, placeholder and custom options.

The downloand is asynchronous and cached.

Declared In

UIButton+WebCache.h

setBackgroundImageWithURL:forState:placeholderImage:options:completed:

Set the backgroundImageView image with an url, placeholder and custom options.

- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock

Parameters

url

The url for the image.

placeholder

The image to be set initially, until the image request finishes.

options

The options to use when downloading the image. @see SDWebImageOptions for the possible values.

success

A block to be executed when the image request succeed This block has no return value and takes the retrieved image as argument.

failure

A block object to be executed when the image request failed. This block has no return value and takes the error object describing the network or parsing error that occurred (may be nil).

Discussion

Set the backgroundImageView image with an url, placeholder and custom options.

The downloand is asynchronous and cached.

Declared In

UIButton+WebCache.h

setImageWithURL:forState:

Set the imageView image with an url.

- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state

Parameters

url

The url for the image.

state

The state that uses the specified title. The values are described in UIControlState.

Discussion

Set the imageView image with an url.

The downloand is asynchronous and cached.

Declared In

UIButton+WebCache.h

setImageWithURL:forState:completed:

Set the imageView image with an url.

- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock

Parameters

url

The url for the image.

state

The state that uses the specified title. The values are described in UIControlState.

completedBlock

A block called when operation has been completed. This block as no return value and takes the requested UIImage as first parameter. In case of error the image parameter is nil and the second parameter may contain an NSError. The third parameter is a Boolean indicating if the image was retrived from the local cache of from the network.

Discussion

Set the imageView image with an url.

The downloand is asynchronous and cached.

Declared In

UIButton+WebCache.h

setImageWithURL:forState:placeholderImage:

Set the imageView image with an url and a placeholder.

- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder

Parameters

url

The url for the image.

state

The state that uses the specified title. The values are described in UIControlState.

placeholder

The image to be set initially, until the image request finishes.

Discussion

Set the imageView image with an url and a placeholder.

The downloand is asynchronous and cached.

Declared In

UIButton+WebCache.h

setImageWithURL:forState:placeholderImage:completed:

Set the imageView image with an url, placeholder.

- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock

Parameters

url

The url for the image.

state

The state that uses the specified title. The values are described in UIControlState.

placeholder

The image to be set initially, until the image request finishes.

completedBlock

A block called when operation has been completed. This block as no return value and takes the requested UIImage as first parameter. In case of error the image parameter is nil and the second parameter may contain an NSError. The third parameter is a Boolean indicating if the image was retrived from the local cache of from the network.

Discussion

Set the imageView image with an url, placeholder.

The downloand is asynchronous and cached.

Declared In

UIButton+WebCache.h

setImageWithURL:forState:placeholderImage:options:

Set the imageView image with an url, placeholder and custom options.

- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options

Parameters

url

The url for the image.

state

The state that uses the specified title. The values are described in UIControlState.

placeholder

The image to be set initially, until the image request finishes.

options

The options to use when downloading the image. @see SDWebImageOptions for the possible values.

Discussion

Set the imageView image with an url, placeholder and custom options.

The downloand is asynchronous and cached.

Declared In

UIButton+WebCache.h

setImageWithURL:forState:placeholderImage:options:completed:

Set the imageView image with an url, placeholder and custom options.

- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock

Parameters

url

The url for the image.

state

The state that uses the specified title. The values are described in UIControlState.

placeholder

The image to be set initially, until the image request finishes.

options

The options to use when downloading the image. @see SDWebImageOptions for the possible values.

completedBlock

A block called when operation has been completed. This block as no return value and takes the requested UIImage as first parameter. In case of error the image parameter is nil and the second parameter may contain an NSError. The third parameter is a Boolean indicating if the image was retrived from the local cache of from the network.

Discussion

Set the imageView image with an url, placeholder and custom options.

The downloand is asynchronous and cached.

Declared In

UIButton+WebCache.h