Skip to content

Commit

Permalink
Bug Fixed #164
Browse files Browse the repository at this point in the history
  • Loading branch information
tilltue committed May 17, 2019
1 parent b17e561 commit f37305b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Example/TLPhotoPicker/CustomCameraCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class CustomCameraCell: TLPhotoCollectionViewCell, AVCaptureFileOutputRecordingD
var videoDeviceInput: AVCaptureDeviceInput!

@IBOutlet private weak var previewView: PreviewView!

override func awakeFromNib() {
super.awakeFromNib()
if Platform.isSimulator {
Expand Down Expand Up @@ -103,7 +102,8 @@ class CustomCameraCell: TLPhotoCollectionViewCell, AVCaptureFileOutputRecordingD
if Platform.isSimulator {
return
}
sessionQueue.async {
sessionQueue.async { [weak self] in
guard let `self` = self else { return }
if self.setupResult == .success {
self.session.stopRunning()
self.isSessionRunning = self.session.isRunning
Expand Down
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.8.7'
s.version = '1.8.9'
s.summary = 'multiple phassets picker for iOS lib. like facebook'

# This description is used to generate tags and improve search results.
Expand Down
7 changes: 5 additions & 2 deletions TLPhotoPicker/Classes/TLPhotosPickerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,6 @@ extension TLPhotosPickerViewController: UICollectionViewDelegate,UICollectionVie
}else{
cell.imageView?.image = self.cameraImage
}
cell.willDisplayCell()
return cell
}
guard let asset = collection.getTLAsset(at: indexPath) else { return cell }
Expand Down Expand Up @@ -986,7 +985,11 @@ extension TLPhotosPickerViewController: UICollectionViewDelegate,UICollectionVie
}

public func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
if self.usedPrefetch, let cell = cell as? TLPhotoCollectionViewCell, let collection = self.focusedCollection, let asset = collection.getTLAsset(at: indexPath) {
guard let cell = cell as? TLPhotoCollectionViewCell else {
return
}
cell.willDisplayCell()
if self.usedPrefetch, let collection = self.focusedCollection, let asset = collection.getTLAsset(at: indexPath) {
if let selectedAsset = getSelectedAssets(asset) {
cell.selectedAsset = true
cell.orderLabel?.text = "\(selectedAsset.selectedOrder)"
Expand Down

0 comments on commit f37305b

Please sign in to comment.