1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- //
- // XHWebImageAutoSize.h
- // XHWebImageHeightLayoutExample
- //
- // Created by zhuxiaohui on 2016/11/16.
- // Copyright © 2016年 it7090.com. All rights reserved.
- // https://github.com/CoderZhuXH/XHWebImageAutoSize
- // 版本:1.1.2
- // 如果你在使用过程中出现bug,请及时以下面任意一种方式联系我,我会及时修复bug并帮您解决问题。
- // QQ交流群:537476189
- // Email:it7090@163.com
- // 新浪微博:朱晓辉Allen
- // GitHub:https://github.com/CoderZhuXH
- // 简书:https://www.jianshu.com/u/acf1a1f12e0f
- // 掘金:https://juejin.im/user/59b50d3cf265da066d331a06
- // 使用说明:https://github.com/CoderZhuXH/XHWebImageAutoSize/blob/master/README.md
- #import <Foundation/Foundation.h>
- #import <UIKit/UIKit.h>
- #import "UITableView+XHWebImageAutoSize.h"
- #import "UICollectionView+XHWebImageAutoSize.h"
- #import "XHWebImageAutoSizeCache.h"
- NS_ASSUME_NONNULL_BEGIN
- @interface XHWebImageAutoSize : NSObject
- /**
- * Get image height
- *
- * @param url imageURL
- * @param layoutWidth layoutWidth
- * @param estimateHeight estimateHeight(default 100)
- *
- * @return imageHeight
- */
- +(CGFloat)imageHeightForURL:(NSURL *)url layoutWidth:(CGFloat)layoutWidth estimateHeight:(CGFloat )estimateHeight;
- /**
- * Get image width
- *
- * @param url imageURL
- * @param layoutHeight layoutHeight
- * @param estimateWidth estimateWidth(default 90)
- *
- * @return imageHeight
- */
- +(CGFloat)imageWidthForURL:(NSURL *)url layoutHeight:(CGFloat)layoutHeight estimateWidth:(CGFloat )estimateWidth;
- /**
- * Get image size from cache,query the disk cache synchronously after checking the memory cache
- *
- * @param url imageURL
- *
- * @return imageSize
- */
- +(CGSize )imageSizeFromCacheForURL:(NSURL *)url;
- /**
- * Store an imageSize into memory and disk cache
- *
- * @param image image
- * @param url imageURL
- * @param completedBlock An block that should be executed after the imageSize has been saved (optional)
- */
- +(void)storeImageSize:(UIImage *)image forURL:(NSURL *)url completed:(nullable XHWebImageAutoSizeCacheCompletionBlock)completedBlock;
- /**
- * Get reload state from cache,query the disk cache synchronously after checking the memory cache
- *
- * @param url imageURL
- *
- * @return reloadState
- */
- +(BOOL)reloadStateFromCacheForURL:(NSURL *)url;
- /**
- * Store an reloadState into memory and disk cache
- *
- * @param state reloadState
- * @param url imageURL
- * @param completedBlock An block that should be executed after the reloadState has been saved (optional)
- */
- +(void)storeReloadState:(BOOL)state forURL:(NSURL *)url completed:(nullable XHWebImageAutoSizeCacheCompletionBlock)completedBlock;
- @end
- NS_ASSUME_NONNULL_END
|