Inherits from NSObject
Declared in AKFileManager.h
AKFileManager.m

Overview

The AKFileManager class manages image persistence for AmazeKit rendering. Images are cached to disk to avoid a rendering penalty on each use. AKFileManager uses the ImageIO framework for blazing-fast disk access and custom PNG saving.

Generally speaking, you should not use these methods yourself. AmazeKit will cache images as needed.

Tasks

Creating a File Manager

Image Caching

Class Methods

amazeKitCachePath

Returns the path to the on-disk cache for images.

+ (NSString *)amazeKitCachePath

Return Value

The path in string format.

Declared In

AKFileManager.h

amazeKitCacheURL

Returns the path to the on-disk cache for images.

+ (NSURL *)amazeKitCacheURL

Return Value

The path in file URL format.

Declared In

AKFileManager.h

defaultManager

Accesses the default AKFileManager instance.

+ (id)defaultManager

Return Value

the default file manager.

Declared In

AKFileManager.h

Instance Methods

cacheImage:forHash:

Saves an image to the on-disk cache. The size and scale are inferred from the image data.

- (void)cacheImage:(UIImage *)image forHash:(NSString *)descriptionHash

Parameters

image

The image to cache.

descriptionHash

The hash to use when saving the image.

Declared In

AKFileManager.h

cachedImageExistsForHash:atSize:withScale:

Returns whether or not an image has already been cached for a given hash. The hash could be for an AKImageEffect or AKImageRenderer.

- (BOOL)cachedImageExistsForHash:(NSString *)descriptionHash atSize:(CGSize)size withScale:(CGFloat)scale

Parameters

descriptionHash

The hashed dictionary representation of the image effect or image renderer.

size

The size to look for on disk.

scale

The scale to look for on disk.

Return Value

YES if the file exists, NO if it does not.

Declared In

AKFileManager.h

cachedImageForHash:atSize:withScale:

Returns a previously-cached image from the on-disk cache.

- (UIImage *)cachedImageForHash:(NSString *)descriptionHash atSize:(CGSize)size withScale:(CGFloat)scale

Parameters

descriptionHash

The hashed dictionary representation of the image effect or image renderer.

size

The size to look for on disk.

scale

The scale to look for on disk.

Return Value

The cached image.

Declared In

AKFileManager.h