After pulling hair out most of my hair, this turned out to be quite simple for xCode 13 / Swift 5.1. There are 2 things that need to be changed.
In your numberOfRowsInSection, add:
tableView.backgroundColor = UIColor.clear
so it looks something like this:
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
tableView.backgroundColor = UIColor.clear
return 40
}
Then in your cellForRowAt, add:
cell?.backgroundColor = UIColor.clear
so it looks like:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell")
cell?.backgroundColor = UIColor.clear
return cell!
}
Thats it. Couldnt believe my eyes when it worked. :)