- (void) hnk_cancelImageRequest |
|
|
|
Cancels the current image request, if any. It is recommended to call this from [UITableViewCell prepareForReuse] or [UICollectionViewCell prepareForReuse], or as soon as you don't need the image view anymore.
- (void) hnk_setImage: |
|
(UIImage*) |
image |
withKey: |
|
(NSString*) |
key |
|
|
| |
- (void) hnk_setImage: |
|
(UIImage*) |
image |
withKey: |
|
(NSString*) |
key |
placeholderImage: |
|
(UIImage*) |
placeholderImage |
|
|
| |
Resizes, displays and caches an appropiately sized image from the given image.
- 引数
-
image | Original image. |
key | A key. Used by the cache to uniquely identify an image. |
placeholderImage | Image to be used as a placeholder until the requested image is ready. The placeholder image will only be used if the requested image is not available in the memory cache. If nil, the image view will not change its image until the requested image is ready. |
- 参照
- - hnk_setImage:withKey:placeholderImage:success:failure:
- (void) hnk_setImage: |
|
(UIImage*) |
image |
withKey: |
|
(NSString*) |
key |
placeholderImage: |
|
(UIImage*) |
placeholderImage |
success: |
|
(void(^)(UIImage *image)) |
successBlock |
failure: |
|
(void(^)(NSError *error)) |
failureBlock |
|
|
| |
Resizes, displays and caches an appropiately sized image from the given image. If a success block is provided you will be responsible for setting the image.
- 引数
-
image | Original image. |
key | A key. Used by the cache to uniquely identify an image. |
placeholderImage | Image to be used as a placeholder until the requested image is ready. The placeholder image will only be used if the requested image is not available in the memory cache. If nil, the image view will not change its image until the requested image is ready. |
successBlock | Block to be called when the requested image is ready to be set. If provided, the block is reponsible for setting the image. Can be nil. |
failureBlock | Block to be called if an error occurs. The most likely cause of error is that the given path does not contain an image. Can be nil. Retrieves an appropiately sized image (based on the bounds and contentMode of the UIImageView) from the memory or disk cache. Disk access is performed in background. If not cached, loads the original image from the given url, produces an appropiately sized image and caches the result, everything in background. If no success block is provided, the requested image will be set with a short fade transition, or synchronously and without transition when retrieved from the memory cache. If needed, the least recently used images in the cache will be evicted in background. |
- 警告
- If a success block is provided you will be responsible for setting the image.
- (void) hnk_setImage: |
|
(UIImage*) |
image |
withKey: |
|
(NSString*) |
key |
success: |
|
(void(^)(UIImage *image)) |
successBlock |
failure: |
|
(void(^)(NSError *error)) |
failureBlock |
|
|
| |
Resizes, displays and caches an appropiately sized image from the given image. If a success block is provided you will be responsible for setting the image.
- 引数
-
image | Original image. |
key | A key. Used by the cache to uniquely identify an image. |
successBlock | Block to be called when the requested image is ready to be set. If provided, the block is reponsible for setting the image. Can be nil. |
failureBlock | Block to be called if an error occurs. The most likely cause of error is that the given path does not contain an image. Can be nil. |
- 警告
- If a success block is provided you will be responsible for setting the image.
- 参照
- - hnk_setImage:withKey:placeholderImage:success:failure:
Loads, resizes, displays and caches an appropiately sized image from the given entity.
- 引数
-
entity | Entity from which the original image will be retrieved if needed. The entity will have to provide the original image or its data only if it can't be found in the cache. |
- 参照
- - hnk_setImageFromEntity:placeholderImage:success:failure:
Loads, resizes, displays and caches an appropiately sized image from the given entity.
- 引数
-
entity | Entity from which the original image will be retrieved if needed. The entity will have to provide the original image or its data only if it can't be found in the cache. |
placeholderImage | Image to be used as a placeholder until the requested image is ready. The placeholder image will only be used if the requested image is not available in the memory cache. If nil, the image view will not change its image until the requested image is ready. |
- 参照
- - hnk_setImageFromEntity:placeholderImage:success:failure:
- (void) hnk_setImageFromEntity: |
|
(id<HNKCacheEntity>) |
entity |
placeholderImage: |
|
(UIImage*) |
placeholderImage |
success: |
|
(void(^)(UIImage *image)) |
successBlock |
failure: |
|
(void(^)(NSError *error)) |
failureBlock |
|
|
| |
Loads, resizes, displays and caches an appropiately sized image from the given entity. If a success block is provided you will be responsible for setting the image.
- 引数
-
entity | Entity from which the original image will be retrieved if needed. The entity will have to provide the original image or its data only if it can't be found in the cache. |
placeholderImage | Image to be used as a placeholder until the requested image is ready. The placeholder image will only be used if the requested image is not available in the memory cache. If nil, the image view will not change its image until the requested image is ready. |
successBlock | Block to be called when the requested image is ready to be set. If provided, the block is reponsible for setting the image. Can be nil. |
failureBlock | Block to be called if an error occurs. The most likely cause of error is that the given path does not contain an image. Can be nil. Retrieves an appropiately sized image (based on the bounds and contentMode of the UIImageView) from the memory or disk cache. Disk access is performed in background. If not cached, loads the original image from the given url, produces an appropiately sized image and caches the result, everything in background. If no success block is provided, the requested image will be set with a short fade transition, or synchronously and without transition when retrieved from the memory cache. If needed, the least recently used images in the cache will be evicted in background. |
- 警告
- If a success block is provided you will be responsible for setting the image.
Loads, resizes, displays and caches an appropiately sized image from the given entity. If a success block is provided you will be responsible for setting the image.
- 引数
-
entity | Entity from which the original image will be retrieved if needed. The entity will have to provide the original image or its data only if it can't be found in the cache. |
successBlock | Block to be called when the requested image is ready to be set. If provided, the block is reponsible for setting the image. Can be nil. |
failureBlock | Block to be called if an error occurs. The most likely cause of error is that the given path does not contain an image. Can be nil. |
- 警告
- If a success block is provided you will be responsible for setting the image.
- 参照
- - hnk_setImageFromEntity:placeholderImage:success:failure:
- (void) hnk_setImageFromFile: |
|
(NSString*) |
path |
|
Loads, resizes, displays and caches an appropiately sized image from the given path.
- 引数
-
path | Path from which the image will be loaded if it's not available in the cache. |
placeholderImage | Image to be used as a placeholder until the requested image is ready. The placeholder image will only be used if the requested image is not available in the memory cache. If nil, the image view will not change its image until the requested image is ready. |
- 参照
- - hnk_setImageFromFile:placeholderImage:success:failure:
- (void) hnk_setImageFromFile: |
|
(NSString*) |
path |
placeholderImage: |
|
(UIImage*) |
placeholderImage |
success: |
|
(void(^)(UIImage *image)) |
successBlock |
failure: |
|
(void(^)(NSError *error)) |
failureBlock |
|
|
| |
Loads, resizes, displays and caches an appropiately sized image from the given path. If a success block is provided you will be responsible for setting the image.
- 引数
-
path | Path from which the image will be loaded if it's not available in the cache. |
placeholderImage | Image to be used as a placeholder until the requested image is ready. The placeholder image will only be used if the requested image is not available in the memory cache. If nil, the image view will not change its image until the requested image is ready. |
successBlock | Block to be called when the requested image is ready to be set. If provided, the block is reponsible for setting the image. Can be nil. |
failureBlock | Block to be called if an error occurs. The most likely cause of error is that the given path does not contain an image. Can be nil. Retrieves an appropiately sized image (based on the bounds and contentMode of the UIImageView) from the memory or disk cache. Disk access is performed in background. If not cached, loads the original image from disk, produces an appropiately sized image and caches the result, everything in background. If no success block is provided, the requested image will be set with a short fade transition, or synchronously and without transition when retrieved from the memory cache. If needed, the least recently used images in the cache will be evicted in background. If the success block is nil, the image will be set with a short fade transition, or inmmediatly if the image was retrieved from the memory cache. |
- 警告
- If a success block is provided you will be responsible for setting the image.
- (void) hnk_setImageFromFile: |
|
(NSString *) |
path |
success: |
|
(void(^)(UIImage *image)) |
successBlock |
failure: |
|
(void(^)(NSError *error)) |
failureBlock |
|
|
| |
Loads, resizes, displays and caches an appropiately sized image from the given path. If a success block is provided you will be responsible for setting the image.
- 引数
-
path | Path from which the image will be loaded if it's not available in the cache. |
successBlock | Block to be called when the requested image is ready to be set. If provided, the block is reponsible for setting the image. Can be nil. |
failureBlock | Block to be called if an error occurs. The most likely cause of error is that the given path does not contain an image. Can be nil. |
- 警告
- If a success block is provided you will be responsible for setting the image.
- 参照
- - hnk_setImageFromFile:placeholderImage:success:failure:
- (void) hnk_setImageFromURL: |
|
(NSURL*) |
url |
|
Loads, resizes, displays and caches an appropiately sized image from the given url.
- 引数
-
url | Url from which the image will be loaded if it's not available in the cache. |
placeholderImage | Image to be used as a placeholder until the requested image is ready. The placeholder image will only be used if the requested image is not available in the memory cache. If nil, the image view will not change its image until the requested image is ready. |
- 参照
- - hnk_setImageFromURL:placeholderImage:success:failure:
- (void) hnk_setImageFromURL: |
|
(NSURL*) |
url |
placeholderImage: |
|
(UIImage*) |
placeholderImage |
success: |
|
(void(^)(UIImage *image)) |
successBlock |
failure: |
|
(void(^)(NSError *error)) |
failureBlock |
|
|
| |
Loads, resizes, displays and caches an appropiately sized image from the given url. If a success block is provided you will be responsible for setting the image.
- 引数
-
url | Url from which the image will be loaded if it's not available in the cache. |
placeholderImage | Image to be used as a placeholder until the requested image is ready. The placeholder image will only be used if the requested image is not available in the memory cache. If nil, the image view will not change its image until the requested image is ready. |
successBlock | Block to be called when the requested image is ready to be set. If provided, the block is reponsible for setting the image. Can be nil. |
failureBlock | Block to be called if an error occurs. The most likely cause of error is that the given path does not contain an image. Can be nil. Retrieves an appropiately sized image (based on the bounds and contentMode of the UIImageView) from the memory or disk cache. Disk access is performed in background. If not cached, loads the original image from the given url, produces an appropiately sized image and caches the result, everything in background. If no success block is provided, the requested image will be set with a short fade transition, or synchronously and without transition when retrieved from the memory cache. If needed, the least recently used images in the cache will be evicted in background. |
- 警告
- If a success block is provided you will be responsible for setting the image.
- (void) hnk_setImageFromURL: |
|
(NSURL*) |
url |
success: |
|
(void(^)(UIImage *image)) |
successBlock |
failure: |
|
(void(^)(NSError *error)) |
failureBlock |
|
|
| |
Loads, resizes, displays and caches an appropiately sized image from the given url. If a success block is provided you will be responsible for setting the image.
- 引数
-
url | Url from which the image will be loaded if it's not available in the cache. |
successBlock | Block to be called when the requested image is ready to be set. If provided, the block is reponsible for setting the image. Can be nil. |
failureBlock | Block to be called if an error occurs. The most likely cause of error is that the given path does not contain an image. Can be nil. |
- 警告
- If a success block is provided you will be responsible for setting the image.
- 参照
- - hnk_setImageFromURL:placeholderImage:success:failure:
The cache format used by the image view. Each image view has a default format created on demand. The default format size matches the bounds of the image view and will scale images based on the contentMode of the the image view. Modifying the default format is discouraged. Instead, you can set your own custom format. To apply the same custom format to various image views you must use the same format instance.
このカテゴリ詳解は次のファイルから抽出されました:
- FrameworkManager/sample/packages/ProjectPackage/iOSSample/Libraries/Haneke/UIImageView+Haneke.h
- FrameworkManager/sample/packages/ProjectPackage/iOSSample/Libraries/Haneke/UIImageView+Haneke.m