Skip to content

Commit

Permalink
Bug fix: #188
Browse files Browse the repository at this point in the history
  • Loading branch information
wade.hawk committed Jul 4, 2019
1 parent 57f5121 commit 23ebaeb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion TLPhotoPicker.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'TLPhotoPicker'
s.version = '1.9.0'
s.version = '1.9.1'
s.summary = 'multiple phassets picker for iOS lib. like facebook'

# This description is used to generate tags and improve search results.
Expand Down
14 changes: 11 additions & 3 deletions TLPhotoPicker/Classes/TLPhotosPickerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,19 @@ open class TLPhotosPickerViewController: UIViewController {
}
}

open func maxCheck() -> Bool {
if self.configure.singleSelectedMode {
open func deselectWhenUsingSingleSelectedMode() {
if
self.configure.singleSelectedMode == true,
let selectedPHAsset = self.selectedAssets.first?.phAsset,
let index = self.focusedCollection?.fetchResult?.index(of: selectedPHAsset)
{
self.selectedAssets.removeAll()
self.orderUpdateCells()
self.collectionView.reloadItems(at: [IndexPath(row: index, section: 0)])
}
}

open func maxCheck() -> Bool {
deselectWhenUsingSingleSelectedMode()
if let max = self.configure.maxSelectedAssets, max <= self.selectedAssets.count {
self.delegate?.didExceedMaximumNumberOfSelection(picker: self)
self.didExceedMaximumNumberOfSelection?(self)
Expand Down

0 comments on commit 23ebaeb

Please sign in to comment.