carousell / pickle

Carousell flavoured image picker with multiple photo selections.
https://carousell.github.com/pickle
Apache License 2.0
60 stars 25 forks source link

Feature: make disabled done button optional #38

Closed wousser closed 5 years ago

wousser commented 5 years ago

Feature: make disabled done button optional

What happens When selecting 3 photos, done button is enabled and will close the picker. When opening again to deselect the 3 photos, the done button is disabled when selection = 0.

Expected Done button is enabled even if selected photos = 0. So that a user can deselect previous selected photos.

bcylin commented 5 years ago

Hi @wousser, thanks for the feedback. The done bar button is disabled because the image picking flow was designed to select at least one image.

For the use case you mentioned, I suppose an optional delegate method can be added:

protocol ImagePickerControllerDelegate {

    /// Optional. Asks the delegate for the flag to enable the done bar button item based on the selected assets.
    @objc optional func imagePickerController(_ picker: ImagePickerController, shouldEnableDonBarButtonItemWithSelected assets: [PHAsset]) -> Bool
}

Would you like to create a pull request for this feature?

nitinumaretiya123 commented 5 years ago

@bcylin

protocol ImagePickerControllerDelegate {
    @objc optional func imagePickerController(_ picker: ImagePickerController, shouldEnableDonBarButtonItemWithSelected assets: [PHAsset]) -> Bool
}

not available