     private func registerNotifications(for results: Results<Class>, in section: Int) {
         let notification = results.addNotificationBlock { [weak self] (changes) in
             guard let tableView = self?.tableView else { return }
-            guard !(self?.searchController.isActive ?? false) else {
+            guard !(self?.isSearchActive ?? false) else {
                 tableView.reloadData()
                 return
             }

        editAction.backgroundColor = UIColor.info
        
        
        let deleteAction = UITableViewRowAction(style: .destructive, title: "Delete", handler: { [weak self] _, path in
            self?.handleDelete(at: path)
        })
        
        deleteAction.backgroundColor = UIColor.warning
        
        return [editAction, deleteAction]
    }
    
    // MARK: Helper Methods

        
        // Present snack bar to allow undo
        let snack = LPSnackbar(title: "Class deleted.", buttonTitle: "UNDO", displayDuration: nil)
        snack.bottomSpacing = (tabBarController?.tabBar.frame.height ?? 0) + 12
        
        snack.show() { [weak self] undone in
            guard undone else { return }
            DatabaseManager.shared.addObject(copy)
            self?.reloadEmptyState()
        }
    }
    
    /// Called whenever a class is favorited. Will update the class in realm and add the appropriate cells to the table view
    private func didFavoriteClass(at path: IndexPath) {
        let classObj = self.classObj(at: path)
        try! DatabaseManager.shared.realm.write {
            classObj.isFavorite = !classObj.isFavorite
        }
    }
    
