Pretty simple code:
func numberOfSectionsInTableView(tableView: UITableView?) -> Int {
return 1
}
func tableView(tableView:UITableView!, numberOfRows
In Swift 5
First I tried registering my UITableViewCell in viewdidload() using class and identifier which I have mentioned below but it did not work for me.
self.tableView.registerClass(MyCustomTableViewCell.self, forCellReuseIdentifier: "customCell")
Solution
Then I registered my UITableViewCell using Nib name and it worked for me
Register your cell in viewdidload() using Nib name
override func viewDidLoad()
{
super.viewDidLoad()
// Do any additional setup after loading the view.
//register your table view cell in Viewdidload() using Nib Name
tableView.register(UINib.init(nibName: "MyCustomTableViewCell", bundle: nil), forCellReuseIdentifier: "customCell")
}