New to IOS development and am having trouble with handling cell selection on a table. Whenever I select, the method is not getting called below - any idea why?
My proje
You have to set an @IBOutlet
to the tableView
in you ViewController
and set as it's delegate
and dataSource
to you can see the data an respond to changes in the tableView
.
Something like this :
override func viewDidLoad() {
super.viewDidLoad()
self.tableView.delegate = self
self.tableView.dataSource = self
}
And implements the UITableViewDataSource
protocol too.
Or you can too in the Interface Builder set the ViewController
as it's delegate and dataSource
(more easy to do I think) and avoid to set manually in code like above. Is up to you.
I hope this help you.