     }
     
     func imagePickerControllerDidDeselect(assets: [DKAsset]) {
-	// Prevent CV bug which could crash in performBatchUpdates
-        self.collectionView.numberOfItems(inSection: 0)
-	    
-        self.collectionView.performBatchUpdates({
-            for indexPathForVisible in self.collectionView.indexPathsForVisibleItems {
-                if let cell = (self.collectionView.cellForItem(at: indexPathForVisible) as? DKAssetGroupDetailBaseCell),
-                    let asset = cell.asset, cell.isSelected {
-                    if let selectedIndex = self.imagePickerController.index(of: asset) {
-                        cell.selectedIndex = selectedIndex
-                    } else if cell.isSelected {
-                        self.collectionView.deselectItem(at: indexPathForVisible, animated: true)
-                    }
+        guard let collectionView = collectionView else {
+            assertionFailure("Expect collectionView")
+            return
+        }
+
+        for indexPathForVisible in collectionView.indexPathsForVisibleItems {
+            if let cell = (collectionView.cellForItem(at: indexPathForVisible) as? DKAssetGroupDetailBaseCell),
+                let asset = cell.asset, cell.isSelected {
+                if let selectedIndex = imagePickerController?.index(of: asset) {
+                    cell.selectedIndex = selectedIndex
+                } else if cell.isSelected {
+                    collectionView.deselectItem(at: indexPathForVisible, animated: true)
                 }
             }
-        }, completion: nil)
+        }
     }
     
 	// MARK: - DKImageGroupDataManagerObserver

    func registerCellIfNeeded(cellClass: DKAssetGroupDetailBaseCell.Type) {
        let cellReuseIdentifier = cellClass.cellReuseIdentifier()
        
        if !self.registeredCellIdentifiers.contains(cellReuseIdentifier) {
            self.collectionView.register(cellClass, forCellWithReuseIdentifier: cellReuseIdentifier)
            self.registeredCellIdentifiers.insert(cellReuseIdentifier)
        }
    }
    
    func dequeueReusableCell(for indexPath: IndexPath) -> DKAssetGroupDetailBaseCell {
        let asset = self.fetchAsset(for: indexPath.row)!
        
        let cellClass: DKAssetGroupDetailBaseCell.Type!
        if asset.type == .video {
            cellClass = self.imagePickerController.UIDelegate.imagePickerControllerCollectionVideoCell()
        } else {
            cellClass = self.imagePickerController.UIDelegate.imagePickerControllerCollectionImageCell()
        }
        self.registerCellIfNeeded(cellClass: cellClass)
        
        let cell = self.collectionView.dequeueReusableCell(withReuseIdentifier: cellClass.cellReuseIdentifier(), for: indexPath) as! DKAssetGroupDetailBaseCell
        self.setup(assetCell: cell, for: indexPath, with: asset)
        
        return cell
    }
    
    func dequeueReusableCameraCell(for indexPath: IndexPath) -> DKAssetGroupDetailBaseCell {
        let cellClass = self.imagePickerController.UIDelegate.imagePickerControllerCollectionCameraCell()
        self.registerCellIfNeeded(cellClass: cellClass)
        
        let cell = self.collectionView.dequeueReusableCell(withReuseIdentifier: cellClass.cellReuseIdentifier(), for: indexPath)
        return cell as! DKAssetGroupDetailBaseCell
    }
	
    func setup(assetCell cell: DKAssetGroupDetailBaseCell, for indexPath: IndexPath, with asset: DKAsset) {

    func selectAssetGroup(_ groupId: String?) {
        self.selectedGroupId = groupId
        self.updateTitleView()
        self.collectionView?.reloadData()
    }
    
	open func updateTitleView() {
        guard let selectedGroupId = self.selectedGroupId else { return }

        guard let imagePickerController = imagePickerController else {
            assertionFailure("Expect imagePickerController")
            return
        }

        guard let group = imagePickerController.groupDataManager.fetchGroup(with: selectedGroupId) else {
            assertionFailure("Expect group")
            return
        }
		self.title = group.groupName
		
		let groupsCount = imagePickerController.groupDataManager.groupIds?.count ?? 0
		self.selectGroupButton.setTitle(group.groupName + (groupsCount > 1 ? "  \u{25be}" : "" ), for: .normal)
		self.selectGroupButton.sizeToFit()
		self.selectGroupButton.isEnabled = groupsCount > 1
