  ------------------------------------------------------------------------------
  
  © 2004-2007 nakamuxu
- © 2014-2016 1024jp
+ © 2014-2017 1024jp
  
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.

        NSAnimationContext.runAnimationGroup({ context in
            // update UI
            tableView.insertRows(at: indexes, withAnimation: .effectGap)
            }, completionHandler: { [weak self] in
                // update data
                let item = NSNumber(value: kCFStringEncodingInvalidId)
                self?.encodings.insert(item, at: rowIndex)
                
                tableView.selectRowIndexes(indexes, byExtendingSelection: false)
        })
    }
    

    private func deleteSeparators(at rowIndexes: IndexSet) {
        
        // pick only separators up
        let toDeleteIndexes = rowIndexes.filteredIndexSet { index in
            self.encodings[index].uint32Value == kCFStringEncodingInvalidId
        }
        
        guard !toDeleteIndexes.isEmpty else { return }
        guard let tableView = self.tableView else { return }
        
        NSAnimationContext.runAnimationGroup({ context in
            // update UI
            tableView.removeRows(at: toDeleteIndexes, withAnimation: [.slideUp, .effectFade])
        }, completionHandler: { [weak self] in
            // update data
            self?.encodings.remove(in: toDeleteIndexes)
        })
    }
    
