ASNetworkImageNode Class Reference
| Inherits from | ASImageNode : ASControlNode : ASDisplayNode : ASDealloc2MainObject |
|---|---|
| Declared in | ASNetworkImageNode.h |
Overview
ASNetworkImageNode is a simple image node that can download and display an image from the network, with support for a
placeholder image (defaultImage). The currently-displayed image is always available in the inherited ASImageNode
– initWithCache:downloader:
The designated initializer.
- (instancetype)initWithCache:(id<ASImageCacheProtocol>)cache downloader:(id<ASImageDownloaderProtocol>)downloaderParameters
cache |
The object that implements a cache of images for the image node. |
|---|---|
downloader |
The object that implements image downloading for the image node. Must not be nil. |
Return Value
An initialized ASNetworkImageNode.
Discussion
If cache is nil, the receiver will not attempt to retrieve images from a cache before downloading them.
Declared In
ASNetworkImageNode.h
– init
Convenience initialiser.
- (instancetype)initReturn Value
An ASNetworkImageNode configured to use the NSURLSession-powered ASBasicImageDownloader, and no extra cache.
Declared In
ASNetworkImageNode.h
delegate
The delegate, which must conform to the ASNetworkImageNodeDelegate protocol.
@property (atomic, weak, readwrite) id<ASNetworkImageNodeDelegate> delegateDeclared In
ASNetworkImageNode.h
defaultImage
A placeholder image to display while the URL is loading.
@property (atomic, strong, readwrite) UIImage *defaultImageDeclared In
ASNetworkImageNode.h
URL
The URL of a new image to download and display.
@property (atomic, strong, readwrite) NSURL *URLDiscussion
Changing this property will reset the displayed image to a placeholder (defaultImage) while loading.
Declared In
ASNetworkImageNode.h
– setURL:resetToDefault:
Download and display a new image.
- (void)setURL:(NSURL *)URL resetToDefault:(BOOL)resetParameters
URL |
The URL of a new image to download and display. |
|---|---|
reset |
Whether to display a placeholder (defaultImage) while loading the new image. |
Declared In
ASNetworkImageNode.h
shouldCacheImage
If URL is a local file, set this property to YES to take advantage of UIKit’s image cacheing. Defaults to YES.
@property (nonatomic, assign, readwrite) BOOL shouldCacheImageDeclared In
ASNetworkImageNode.h