YahooArchive / YangMingShan

YangMingShan is a collection of iOS UI components that we created while building Yahoo apps.
Other
638 stars 97 forks source link

picking 1 image issue #40

Closed Sunbir closed 7 years ago

Sunbir commented 7 years ago

When picking 1 image the picker UI dismisses immediately after selection and does not invoke the delegate didFinishPickingImages handler.

        let pickerViewController = YMSPhotoPickerViewController.init()
        pickerViewController.numberOfPhotoToSelect = 1
        ...
        viewController.yms_presentCustomAlbumPhotoView(pickerViewController, delegate: self)
Sunbir commented 7 years ago

Closing... I wasn't setting the shouldReturnImageForSingleSelection attribute when the # of photos to select was 1.

        let pickerViewController = YMSPhotoPickerViewController.init()
        pickerViewController.numberOfPhotoToSelect = count
        if count == 1 {
            pickerViewController.shouldReturnImageForSingleSelection = false
        }
        ...
        viewController.yms_presentCustomAlbumPhotoView(pickerViewController, delegate: self)