I have a UIView which contains a UITableView. The tableview\'s delegate is set to my UIView, but it never calls the delegate methods:
-(id)init {
self = [sup
I accidentally set my tableView's allowsSelection property to false.
Storyboard solution
Select your table view and set the following...
Swift solution
override func viewDidLoad() {
super.viewDidLoad()
tableView.allowsSelection = true
}
Notes
UITableViewDelegate issue (as other answers suggested). It wasn't. I linked it to my view controller in my storyboard. UITableViewDataSource issue, in that I didn't implement the protocol's numberOfSections(in tableView:) method (as other answers suggested). It wasn't. According UIKit's documentation,// Default is 1 if not implemented