         else {
             detailController?.updateUI()
         }
-        
-        // If were in the search controller also remove this class from the filtered classes array
-        // Since this array is just a flat copy of classesBySection, but hasn't been updated when deleting
-        if isSearchActive {
-            filteredClasses.remove(at: indexPath.row)
-        }
-        
-        // Refresh tableView
-        self.tableView.reloadData()
-        self.reloadEmptyState()
     }
     
     /// Creates the older legacy swipe actiions for a tableview used in iOS versions less than 11.0

                                                                                    as? ClassDetailTableViewController
        if detailController?.classObj == classToDel { shouldUpdateDetail = true }
        
        // Delete class object and its associated properties from Realm
        let realm = try! Realm()
        try! realm.write {
            realm.delete(classToDel.rubrics)
            realm.delete(classToDel.semester!)
            realm.delete(classToDel.assignments)
            realm.delete(classToDel.grade!)
            realm.delete(classToDel)
        }
        
        // Update detail if needed
        if shouldUpdateDetail {

    
    /// Deletes a classObj from Realm using a specified indexPath
    private func deleteClassObj(at indexPath: IndexPath) {
        let realm = try! Realm()
        let classToDel: Class = classObj(at: indexPath)
        
        // Block which deletes all associated objects and the class from realm db
        let deleteAll = {
            try! realm.write {
                realm.delete(classToDel.rubrics)
                realm.delete(classToDel.semester!)
                realm.delete(classToDel.assignments)
                realm.delete(classToDel.grade!)
                realm.delete(classToDel)
            }
        }
        
        // Block for reloading class sections if required
        let reloadClassSectionIfNeeded: (IndexPath) -> Void = { path in
            if self.classesBySection[path.section].count == 0 {
                self.tableView.reloadSections(IndexSet.init(integer: path.section), with: .automatic)
            }
        }
        // Block for reloading the favorites section if required
        let reloadFavoritesSectionIfNeeded: (IndexPath) -> Void = { path in
            if self.favoritedClasses.count == 0 {
                self.tableView.reloadSections(IndexSet.init(integer: path.section), with: .automatic)
            }
        }
        
        // Figure out whether we need to update the state of the detail controller or not
        // If yes then remove the detail controllers classObj, which will cause the view to configure and show correct message
