If you know the position of your customCell then you can easily achieve this programmatically by calling tableView delegate following ways:
Suppose your custom cell is in the last index then:
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard indexPath.row == models.count - 1 else {
//behavior of other cell
return
}
navigateToTestViewController()
}
But if you have a button in a customCell then you have to use delegate or reactive approach to send delegate to parentController to perform navigation.
Update:
If you only need to make cell of type customCell navigable then you can do following way:
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let cell = tableView.cellForRow(at: indexPath)
guard cell is CustomCellTableViewCell else { return }
navigateToTestViewController()
}