Inherits from NSObject
Conforms to NSCacheDelegate
Declared in ImageLoader.h

Overview

The ImageLoader class provides a centralized point for loading images in Titanium. Using ImageLoader is the preferred way for getting images from remote sources.

The class is singleton and not supposed to be subclassed. The instance should not be instantiated directly, but lazily created with sharedLoader.

Tasks

Class Methods

sharedLoader

Returns the shared instance of image loader.

+ (ImageLoader *)sharedLoader

Return Value

The shared instance.

Declared In

ImageLoader.h

Instance Methods

cancel

Tells the image loader to cancel all activities.

- (void)cancel

Declared In

ImageLoader.h

fullImageSize:

Returns the full image size.

- (CGSize)fullImageSize:(NSURL *)url

Parameters

url

The image URL

Return Value

The image size.

Declared In

ImageLoader.h

loadImage:delegate:userInfo:

Tells the loader to load image from URL with delegate.

- (ImageLoaderRequest *)loadImage:(NSURL *)url delegate:(NSObject<ImageLoaderDelegate> *)delegate userInfo:(NSDictionary *)userInfo

Parameters

url

The image URL.

delegate

The loader delegate.

userInfo

The additional properties to be assigned to the request.

Return Value

The image load request.

See Also

Declared In

ImageLoader.h

loadImmediateImage:

Tells the loader to return previously loaded image with URL.

- (UIImage *)loadImmediateImage:(NSURL *)url

Parameters

url

The image URL

Return Value

The loaded image or nil if the image is not available from the cache.

See Also

Declared In

ImageLoader.h

loadImmediateImage:withSize:

Tells the loader to return previously loaded image with URL and size.

- (UIImage *)loadImmediateImage:(NSURL *)url withSize:(CGSize)imageSize

Parameters

url

The image URL

imageSize

The required image size.

Return Value

The loaded image or nil if the image is not available from the cache.

See Also

Declared In

ImageLoader.h

loadImmediateStretchableImage:

Tells the loader to return previously loaded stretchable image with URL.

- (UIImage *)loadImmediateStretchableImage:(NSURL *)url

Parameters

url

The image URL

Return Value

The loaded image or nil if the image is not available from the cache.

See Also

Declared In

ImageLoader.h

loadImmediateStretchableImage:withLeftCap:topCap:

Tells the loader to return previously loaded stretchable image with URL and specified cap values.

- (UIImage *)loadImmediateStretchableImage:(NSURL *)url withLeftCap:(TiDimension)left topCap:(TiDimension)top

Parameters

url

The image URL

left

The value to use for the left cap width. Specify 0 if you want the entire image to be horizontally stretchable.

top

The value to use for the top cap width. Specify 0 if you want the entire image to be vertically stretchable.

Return Value

The loaded image or nil if the image is not available from cache.

See Also

Declared In

ImageLoader.h

loadRemote:

Tells the loader to load remote image from URL.

- (UIImage *)loadRemote:(NSURL *)url

Parameters

url

The image URL

Return Value

The loaded image.

Declared In

ImageLoader.h