kevinabraham kevinabraham - 8 months ago 45
Swift Question

How to add image to table view controller

Im trying to add an image as a background behind table view controller with multiple cells,already I'm using an imageView but having an issue where the background doesn't go behind the text but above or below the cells.

enter image description here

My file structure looks like:
enter image description here


To set overall background image to a UITableView use below code

var backGroundImage: UIImageView = UIImageView(image: UIImage(named:  "backGroundImage.png"))
self.tableView.backgroundView = backGroundImage