longitachi / ZLPhotoBrowser

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

有个方法编辑后怎么拿到编辑后的数据,没有看到回调,或者有其他办法实现吗 #764

Closed jaylanlu closed 2 years ago

jaylanlu commented 2 years ago

@objc public func previewAssets( sender: UIViewController, assets: [PHAsset], index: Int, isOriginal: Bool, showBottomViewAndSelectBtn: Bool = true ) 这个方法我想传入图片编辑之后回调给我,但是没有看到回调方法

jaylanlu commented 2 years ago

我是想传入图片之后直接进入编辑页编辑之后,能拿到回调的数据

longitachi commented 2 years ago

直接调用图片编辑器用这个 https://github.com/longitachi/ZLPhotoBrowser/wiki/How-to-use-(Swift)#Use-image-editor

jaylanlu commented 2 years ago

现在只支持传入单个图片吗,还有支持参数是PHAsset数组吗,回调数据也只有image这种类型

jaylanlu commented 2 years ago

还有我要进去的和@objc public func previewAssets( sender: UIViewController, assets: [PHAsset], index: Int, isOriginal: Bool, showBottomViewAndSelectBtn: Bool = true )这个法是一样的

longitachi commented 2 years ago

这种预览PHAsset的话,点击完成的话同样会走selectImageBlock啊,怎么会拿不到结果呢

jaylanlu commented 2 years ago

嗯嗯,是可以的,然后我有个新的问题,这样进去之后点击导航栏的返回按钮cancelBlock是没有执行的,那么现在我有其他办法拿到返回事件的回调吗

longitachi commented 2 years ago

嗯嗯,是可以的,然后我有个新的问题,这样进去之后点击导航栏的返回按钮cancelBlock是没有执行的,那么现在我有其他办法拿到返回事件的回调吗

这个是个bug - -,下个版本修复一下 你可以先在previewAssets(sender:assets:index:isOriginal:showBottomViewAndSelectBtn:)方法里这么改下

vc.backBlock = { [weak self] in
    self?.hide { [weak self] in
        self?.cancelBlock?()
    }
}