YahooArchive/YangMingShan

picking 1 image issue

Sunbir opened this issue · 1 comments

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)

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)