Вы можете попробовать
Вариант 1:
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return carsArray.count + 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row < carsArray.count {
let rowData = carsArray[indexPath.row]
let cell = tableView.dequeueReusableCell(withIdentifier: "carCell") as! CarCell
cell.setButton(name: rowData.name)
return cell
}
else {
// implement the last cell
}
}
Вариант 2:
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let footerView = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.size.width, height: 50))
return footerView
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 50
}