Here is an simpler way to da cell animation on tap in Swift 5.0:
func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath){ let cell = tableView.cellForRow(at: indexPath) UIView.animate(withDuration: 0.3) { cell!.transform = CGAffineTransform(scaleX: 0.8, y: 0.8) }}func tableView(_ tableView: UITableView, didUnhighlightRowAt indexPath: IndexPath){ let cell = tableView.cellForRow(at: indexPath) UIView.animate(withDuration: 0.3) { cell!.transform = .identity }}