April 2017
Intermediate to advanced
316 pages
9h 33m
English
Finally, we need to implement the delegate and datasource methods for UITableViewController. The code is as follows:
// MARK: UITableViewController extension MasterViewController { override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return viewModel.todos.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "todoCell", for: indexPath) as! TodoTableViewCell let todo = viewModel.todoForIndexPath(indexPath) cell.configure(todo) return cell } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let ...Read now
Unlock full access