TTImageView Class Reference

A view that asynchronously loads an image and subsequently displays it. More...

#import <TTImageView.h>

Inheritance diagram for TTImageView:
TTView <TTURLRequestDelegate> UIView <TTStyleDelegate> TTPhotoView

List of all members.

Public Member Functions

(void) - unsetImage
 Cancel any pending request, remove the image, and redraw the view.
(void) - reload
 Force the image to be reloaded.
(void) - stopLoading
 Cancel this image views' active asynchronous requests.
(void) - imageViewDidStartLoad
 Called when the image begins loading asynchronously.
(void) - imageViewDidLoadImage:
 Called when the image finishes loading asynchronously.
(void) - imageViewDidFailLoadWithError:
 Called when the image failed to load asynchronously.
(void) - setImage:
 Useful when overriding the TTImageView class's setImage method.

Protected Attributes

TTURLRequest_request
NSString_urlPath
UIImage_image
UIImage_defaultImage
BOOL _autoresizesToImage
id< TTImageViewDelegate_delegate

Properties

NSStringurlPath
 The path of the image.
UIImagedefaultImage
 The default image that is displayed until the image has been downloaded.
UIImageimage
 The image that is currently being displayed.
BOOL autoresizesToImage
 Override the default sizing operation and resize the frame of this view with the size of the image.
BOOL isLoading
 Is an asynchronous request currently active?
BOOL isLoaded
 Has the image been successfully loaded?
id< TTImageViewDelegatedelegate
 A delegate that notifies you when the image has started and finished loading.

Detailed Description

A view that asynchronously loads an image and subsequently displays it.


Member Function Documentation

- (void) imageViewDidFailLoadWithError: (NSError*)  error  

Called when the image failed to load asynchronously.

Overridable method.

- (void) imageViewDidLoadImage: (UIImage*)  image  

Called when the image finishes loading asynchronously.

Overridable method.

- (void) imageViewDidStartLoad  

Called when the image begins loading asynchronously.

Overridable method.

- (void) reload  

Force the image to be reloaded.

If the image is not in the cache, an asynchronous request is sent off to fetch the image.

- (void) setImage: (UIImage *)  image  

Useful when overriding the TTImageView class's setImage method.

See also:
TTPhotoView

Property Documentation

- (BOOL) autoresizesToImage [read, write, assign]

Override the default sizing operation and resize the frame of this view with the size of the image.

NO

- (UIImage*) defaultImage [read, write, retain]

The default image that is displayed until the image has been downloaded.

If no urlPath is specified, this image will be displayed indefinitely.

- (NSString*) urlPath [read, write, copy]

The path of the image.

This may be a web path (http://path/to/image.gif) or a local bundle path (bundle://path/to/image.png).


The documentation for this class was generated from the following files:
  • Three20UI/Headers/TTImageView.h
  • Three20UI/Sources/TTImageView.m
blog comments powered by Disqus