As you are putting two table views in the same controller, the delegate/data source for both table views will connect to the same controller. You will have to identify that which table view has to be updated. You can do this by taking the outlets of both the table views and then applying a simple conditional construct in cellForRowAt.
This is how I implemented.

Code
extension ViewController: UITableViewDelegate, UITableViewDataSource
{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if tableView == firstTableView
{
if let cell = tableView.dequeueReusableCell(withIdentifier: "prototypeOne", for: indexPath) as? UITableViewCell
{
cell.textLabel?.text = "First table view. Row \(indexPath.row)"
return cell
}
else
{
let cell = UITableViewCell.init(style: .default, reuseIdentifier: "prototypeOne")
cell.textLabel?.text = "First table view. Row \(indexPath.row)"
return cell
}
}
else if tableView == secondTableView
{
if let cell = tableView.dequeueReusableCell(withIdentifier: "prototypeTwo", for: indexPath) as? UITableViewCell
{
cell.textLabel?.text = "Second table view. Row \(indexPath.row)"
return cell
}
else
{
let cell = UITableViewCell.init(style: .default, reuseIdentifier: "prototypeTwo")
cell.textLabel?.text = "Second table view. Row \(indexPath.row)"
return cell
}
}
return UITableViewCell()
}
}
Output
