Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
nek023 committed Apr 6, 2015
1 parent e49b4d6 commit 274c5a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions QBImagePicker/QBAssetsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ - (void)setAssetsGroup:(ALAssetsGroup *)assetsGroup

[self updateAssets];

// Find previous selected item if needed
if ([self isAutoDeselectEnabled]) {
if ([self isAutoDeselectEnabled] && self.imagePickerController.selectedAssetURLs.count > 0) {
// Get index of previous selected asset
NSURL *previousSelectedAssetURL = [self.imagePickerController.selectedAssetURLs firstObject];

[self.assets enumerateObjectsUsingBlock:^(ALAsset *asset, NSUInteger index, BOOL *stop) {
Expand All @@ -128,7 +128,7 @@ - (void)setAssetsGroup:(ALAssetsGroup *)assetsGroup

[self.collectionView reloadData];
}
//

- (BOOL)isAutoDeselectEnabled
{
return (self.imagePickerController.maximumNumberOfSelection == 1
Expand Down

0 comments on commit 274c5a5

Please sign in to comment.