extension UITableView {
func reloadData(completion: @escaping () -> Void) {
UIView.animate(withDuration: 0, animations: {
self.reloadData()
}) { _ in
completion()
}
}
func insertRows(indexPaths: [IndexPath],
animation: UITableViewRowAnimation = .automatic,
completion: @escaping () -> Void) {
UIView.animate(withDuration: 0, animations: {
insertRows(at: indexPaths, with: animation)
}) { _ in
completion()
}
}
func deleteRows(indexPaths: [IndexPath],
animation: UITableViewRowAnimation = .automatic,
completion: @escaping () -> Void) {
UIView.animate(withDuration: 0, animations: {
deleteRows(at: indexPaths, with: animation)
}) { _ in
completion()
}
}
}
Last active
January 19, 2019 14:55
-
-
Save KentarouKanno/41d79551e2cbb92300ec29fc812bc166 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment