diff --git a/TLPhotoPicker.podspec b/TLPhotoPicker.podspec index 98200970..b8542c6f 100644 --- a/TLPhotoPicker.podspec +++ b/TLPhotoPicker.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'TLPhotoPicker' - s.version = '1.6.7' + s.version = '1.6.8' s.summary = 'multiple phassets picker for iOS lib. like facebook' # This description is used to generate tags and improve search results. diff --git a/TLPhotoPicker/Classes/TLPhotoCollectionViewCell.swift b/TLPhotoPicker/Classes/TLPhotoCollectionViewCell.swift index 00e1cf84..21114322 100644 --- a/TLPhotoPicker/Classes/TLPhotoCollectionViewCell.swift +++ b/TLPhotoPicker/Classes/TLPhotoCollectionViewCell.swift @@ -67,10 +67,12 @@ open class TLPhotoCollectionViewCell: UICollectionViewCell { if self.configure.autoPlay == false { return } if self.player == nil { self.playerView?.playerLayer.player = nil - NotificationCenter.default.removeObserver(observer) + if let oberver = self.observer { + NotificationCenter.default.removeObserver(observer) + } }else { self.playerView?.playerLayer.player = self.player - observer = NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: self.player?.currentItem, queue: nil, using: { [weak self] (_) in + self.observer = NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: self.player?.currentItem, queue: nil, using: { [weak self] (_) in DispatchQueue.main.async { guard let `self` = self else { return } self.player?.seek(to: kCMTimeZero) diff --git a/TLPhotoPicker/Classes/TLPhotoLibrary.swift b/TLPhotoPicker/Classes/TLPhotoLibrary.swift index f8b93fc6..5c1eb3a1 100644 --- a/TLPhotoPicker/Classes/TLPhotoLibrary.swift +++ b/TLPhotoPicker/Classes/TLPhotoLibrary.swift @@ -160,7 +160,6 @@ extension TLPhotoLibrary { let useCameraButton = configure.usedCameraButton let options = getOption(configure: configure) - @discardableResult func getAlbum(subType: PHAssetCollectionSubtype, result: inout [TLAssetsCollection]) { let fetchCollection = PHAssetCollection.fetchAssetCollections(with: .album, subtype: subType, options: nil) var collections = [PHAssetCollection]() diff --git a/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift b/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift index f0e689c7..ae28080b 100644 --- a/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift +++ b/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift @@ -769,7 +769,7 @@ extension TLPhotosPickerViewController: UICollectionViewDelegate,UICollectionVie print("not supported by the simulator.") return }else { - if let nibName = self.configure.cameraCellNibSet?.nibName { + if self.configure.cameraCellNibSet?.nibName != nil { cell.selectedCell() }else { self.logDelegate?.selectedCameraCell(picker: self)