简单的图像存储/缓存库。
导入
#import <ALImageStore/ALImageStore+Singleton.h>
然后您可以获取默认存储库
[ALImageStore defaultStore]
您可以通过
@property (strong, nonatomic) NSString *imagesFolderName;
并设置useTmpDirectory属性为true强制使用/tmp文件夹进行存储
[ALImageStore defaultStore].useTmpDirectory = YES;
这应该在例如在AppDelegate之后一次完成。
默认情况下,所有图像都存储在应用的Documents目录中,在/图像目录下。
存储库可以自动翻转和旋转图像到正常状态,例如从相机中捕获的图像
[ALImageStore defaultStore].shouldAutoFixImages = YES;
默认情况下,此选项已关闭。
将设备上存储的图像复制到存储库,并返回其imageID。
- (NSString*)imageIDForImageWithFile:(NSString*)filePath;
保存图像到设备并返回其ID。
- (NSString*)imageIDForImage:(UIImage*)image withKey:(NSString*)key;
使用给定的imageID检索图像。
- (UIImage*)imageWithID:(NSString*)imageID;
使用给定的imageID从设备中删除图像。
- (void)removeImageWithID:(NSString*)imageID;
从设备中删除所有图像。
- (void)resetStore;
Aziz U. Latypov,[email protected]
ALImageStore可在MIT许可证下使用。有关更多信息,请参阅LICENSE文件。