Closed raketenok closed 4 years ago
I have merged this pull request into my fork. There is an issue when tapping on 'wrapper' button when no images are selected:
After quick analysis, I have found out that your method resolveAssets(_ assets:, imagesClosers: )
does not call 'imagesClosers' callback in case when 'assets' array is empty. Fixed it by adding this line before for asset in assets {...}
loop:
guard !assets.isEmpty else { return imagesClosers(imagesData) }
Also, could you please pass 'imagePicker' reference in your new delegate methods wrapperDidPress(images: [(imageData: Data,location: CLLocation?)])
and doneButtonDidPress(images: [(imageData: Data,location: CLLocation?)])
so that they have similar signature as original delegate methods, because the host application might need that reference inside delegate methods.
Fixed, you can review
@raketenok Can you please update the ImagePickerDemo
to demonstrate your changes, as it currently breaks things.
Also, the variable open static var photoQuality: AVCaptureSession.Preset?
is never set anywhere, which never triggers your new wrapperDidPress
and doneButtonDidPress
delegates. Unless I'm missing something.
fyi: https://github.com/sedwo/ImagePicker/commit/a75cbf81df6987aa26b5549a3b7a0f4b6339fb28
I added a description, made the methods optional and updated the demo