Don't end the operation until the deselection animation has completed. (Regression)

This commit is contained in:
Maurice Parker 2020-02-24 08:07:14 -08:00
parent afadadff69
commit 23b8af4634

View File

@ -40,8 +40,17 @@ class UpdateSelectionOperation: MainThreadOperation {
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animations: animations)
CATransaction.commit()
} else {
tableView.selectRow(at: nil, animated: animations.contains(.select), scrollPosition: .none)
self.operationDelegate?.operationDidComplete(self)
if animations.contains(.select) {
CATransaction.begin()
CATransaction.setCompletionBlock {
self.operationDelegate?.operationDidComplete(self)
}
tableView.selectRow(at: nil, animated: true, scrollPosition: .none)
CATransaction.commit()
} else {
tableView.selectRow(at: nil, animated: false, scrollPosition: .none)
self.operationDelegate?.operationDidComplete(self)
}
}
} else {
self.operationDelegate?.operationDidComplete(self)