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

Overview

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

Instance Methods

cancelCurrentImageLoad

Cancel the current download

- (void)cancelCurrentImageLoad

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

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.

completedBlock

A block object to be executed after the request operation completed. This block has no return value and takes three argument: the requested UIImage object, the NSError object describing error that occurred, and an SDImageCacheType enum describing the source of the image obtained from.

Discussion

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

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.

completedBlock

A block object to be executed after the request operation completed. This block has no return value and takes three argument: the requested UIImage object, the NSError object describing error that occurred, and an SDImageCacheType enum describing the source of the image obtained from.

Discussion

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

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.

completedBlock

A block object to be executed after the request operation completed. This block has no return value and takes three argument: the requested UIImage object, the NSError object describing error that occurred, and an SDImageCacheType enum describing the source of the image obtained from.

Discussion

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

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

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

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

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

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

The downloand is asynchronous and cached.

Declared In

UIButton+WebCache.h