I was working on the to-do list app. I added the prototype cell and its identifier as a cell. but the cells are not showing in the table view while running in the simulator. Can anyone tell me what mistakes I am making? The following is code from the view controller. import UIKit
class ViewController: UIViewController {
@IBOutlet var tableView : UITableView!
let Tasks : [String] = []
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func didTapAdd(){
}
}
extension ViewController : UITextViewDelegate , UITableViewDataSource{ func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return Tasks.count }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
cell.textLabel?.text = Tasks[indexPath.row]
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath : IndexPath){
tableView.deselectRow(at: indexPath, animated: true)
}
}