i have a UITableView, where theres 3 images. 1 for the selected Cell, 1 for the Cell background, and 1 for the TableView background.
My selected Cell, is working jus
In Swift 4, this works:
cell.backgroundView = UIImageView.init(image: UIImage.init(named: "YORIMAGE.jpg"))
In swift you can set background image to UITableViewCell like below.
cell.backgroundView = UIImageView(image: UIImage(named: "yourImage.png")!)
Write this code in this function of table view.
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
This image will repeat fort each row.
this sets the background for the tableView not the cell
// CELL'S BACKGROUND-IMAGE
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"cell_normal.PNG"]];
try get set cellbackground in cellForRowAtIndexPath
cell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"cell_normal.PNG"]];