Skip to content
This repository was archived by the owner on Jul 15, 2019. It is now read-only.

Commit 524e7fb

Browse files
committed
Fix select/deselect events for camera cell
1 parent dbdf46e commit 524e7fb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

YangMingShan/YMSPhotoPicker/Public/YMSPhotoPickerViewController.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ - (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtInde
234234
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
235235
{
236236
if (indexPath.row == 0) {
237+
[self.photoCollectionView deselectItemAtIndexPath:indexPath animated:NO];
237238
[self yms_presentCameraCaptureViewWithDelegate:self];
238239
}
239240
else if (NO == self.allowsMultipleSelection) {
@@ -457,8 +458,6 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking
457458
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
458459
{
459460
[picker dismissViewControllerAnimated:YES completion:^(){
460-
[self.photoCollectionView deselectItemAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0] animated:NO];
461-
462461
// Enable camera preview when user allow it first time
463462
if (![self.session isRunning]) {
464463
[self.photoCollectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:0 inSection:0]]];

0 commit comments

Comments
 (0)