     }
     
     @objc func controllerWillChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) {
-        self.updateSectionCounts()
+        previousSectionCounts = fetchSectionCounts()
         sectionChanges = []
         objectChanges = []
     }

                columnarLayout.animateItems = true
                columnarLayout.slideInNewContentFromTheTop = false
                UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: .allowUserInteraction, animations: {
                    self.performBatchUpdates(sectionCounts: sectionCounts, previousSectionCounts: previousSectionCounts)
                }, completion: nil)
            } else {
                columnarLayout.animateItems = false
                columnarLayout.slideInNewContentFromTheTop = false
                performBatchUpdates(sectionCounts: sectionCounts, previousSectionCounts: previousSectionCounts)
            }
            return
        }
        columnarLayout.animateItems = true
        columnarLayout.slideInNewContentFromTheTop = true
        UIView.animate(withDuration: 0.7 + 0.1 * TimeInterval(objectsInSectionDelta), delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: .allowUserInteraction, animations: {
            self.performBatchUpdates(sectionCounts: sectionCounts, previousSectionCounts: previousSectionCounts)
        }, completion: nil)
    }
    
    func performBatchUpdates(sectionCounts: [Int], previousSectionCounts: [Int]) {
        let collectionView = self.collectionView
        collectionView.performBatchUpdates({
            DDLogDebug("=== WMFBU BATCH UPDATE START ===")
            let insertedSections = NSMutableIndexSet()
            let deletedSections = NSMutableIndexSet()
            let updatedSections = NSMutableIndexSet()
            
            for sectionChange in sectionChanges {
                switch sectionChange.type {
                case .delete:
                    DDLogDebug("WMFBU section delete: \(sectionChange.sectionIndex)")
                    collectionView.deleteSections(IndexSet(integer: sectionChange.sectionIndex))
                    deletedSections.add(sectionChange.sectionIndex)
                case .insert:
                    DDLogDebug("WMFBU section insert: \(sectionChange.sectionIndex)")
                    collectionView.insertSections(IndexSet(integer: sectionChange.sectionIndex))
                    insertedSections.add(sectionChange.sectionIndex)
                default:
                    DDLogDebug("WMFBU section update: \(sectionChange.sectionIndex)")
                    collectionView.reloadSections(IndexSet(integer: sectionChange.sectionIndex))
                    updatedSections.add(sectionChange.sectionIndex)
                }
            }
            for objectChange in objectChanges {

        }
        
        guard isSlidingNewContentInFromTheTopEnabled else {
            performBatchUpdates()
            return
        }

        guard let columnarLayout = collectionView.collectionViewLayout as? ColumnarCollectionViewLayout else {
            performBatchUpdates()
            return
        }
        
