import UIKit
class ViewController: UIViewController, UITableViewDataSource,UITableViewDelegate {
@IBOutlet weak var label: UILabel!
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var tableView1: UITableView!
let element = ["Sports": #imageLiteral(resourceName: "ios"),"Grocery":#imageLiteral(resourceName: "ios"),"Cosmetics":#imageLiteral(resourceName: "ios")]
override func viewDidLoad() {
super.viewDidLoad()
tableView1.delegate = self
tableView1.dataSource = self
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { …
Run Code Online (Sandbox Code Playgroud)