FWImagePreviewPlugin
@protocol FWImagePreviewPlugin <NSObject>
图片预览插件协议,应用可自定义图片预览插件实现
-
-viewController:
showImagePreview: imageInfos: currentIndex: sourceView: placeholderImage: renderBlock: customBlock: 显示图片预览方法
Declaration
Objective-C
- (void)viewController:(nonnull UIViewController *)viewController showImagePreview:(nonnull NSArray *)imageURLs imageInfos:(nullable NSArray *)imageInfos currentIndex:(NSInteger)currentIndex sourceView:(nullable id _Nullable (^)(NSInteger))sourceView placeholderImage: (nullable UIImage *_Nullable (^)(NSInteger))placeholderImage renderBlock:(nullable void (^)(__kindof UIView *_Nonnull __strong, NSInteger))renderBlock customBlock:(nullable void (^)(id _Nonnull __strong))customBlock;
Parameters
viewController
当前视图控制器
imageURLs
预览图片列表,支持NSString|UIImage|PHLivePhoto|AVPlayerItem类型
imageInfos
自定义图片信息数组
currentIndex
当前索引,默认0
sourceView
来源视图句柄,支持UIView|NSValue.CGRect,默认nil
placeholderImage
占位图或缩略图句柄,默认nil
renderBlock
自定义渲染句柄,默认nil
customBlock
自定义配置句柄,默认nil