longitachi / ZLPhotoBrowser

Wechat-like image picker. Support select photos, videos, gif and livePhoto. Support edit image and crop video. 微信样式的图片选择器,支持预览/相册内拍照及录视频、拖拽/滑动选择,编辑图片/视频,支持多语言国际化等功能;
MIT License
4.76k stars 965 forks source link

请问如何在selectImageBlock回调里自己控制什么时候dismiss谢谢 #918

Open StayStar opened 1 month ago

StayStar commented 1 month ago

Issue Description

Description and Steps

Please fill in the detailed description of the issue (full output of any stack trace, compiler error, ...) and the steps to reproduce the issue.

Info

ZLPhotoBrowser version: e.g. 4.5.4 Device: e.g. iPhone 14 Pro Device version: e.g. iOS 16.0 Xcode version: e.g. Xcode 14.0

Configuration code of ZLPhotoConfiguration

   Paste your code here.
        let ps = ZLPhotoPreviewSheet(selectedAssets: assets)
        ps.selectImageBlock = {models, isOriginal in
            // 写一些压缩图片视频的逻辑,等压缩完以后再将ps dismiss如何修改...

        }
        ps.showPhotoLibrary(sender: sender)
longitachi commented 1 month ago

不支持这个样子,可以相册dismiss之后,你在给个loading框去做不也行吗?

StayStar commented 1 month ago

做聊天界面,如果在聊天窗口loading效果不太好,如果修改ZLPhotoPreviewSheet的话 guard !arrSelectedModels.isEmpty else { selectImageBlock?([], isSelectOriginal) hide() viewController?.dismiss(animated: true, completion: nil) return }这个方法我需要处理吗?

StayStar commented 1 month ago

if let vc = viewController { vc.dismiss(animated: true) { call() self?.hide() } } else { self?.hide { call() } }我可以手动处理这个dismiss

longitachi commented 1 month ago

做聊天界面,如果在聊天窗口loading效果不太好,如果修改ZLPhotoPreviewSheet的话 guard !arrSelectedModels.isEmpty else { selectImageBlock?([], isSelectOriginal) hide() viewController?.dismiss(animated: true, completion: nil) return }这个方法我需要处理吗?

理论上是不会走到这里的,走到这里代表没选择任何图片,也不用处理

ZClee128 commented 4 weeks ago

我也希望可以外部控制,dismiss