So here's my strange problem.
I have a small app which uses storyboard.
I have 1 UITabBarController
which has 2 tabs:
- 1 UITableViewController
(subclassed)
- 1 UIViewController
(just has a UILabel and does nothing till now)
The UITableViewController is subclassed and i provided:
- numberOfSectionsInTableView(tableView: UITableView) -> Int
- tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
- tableView(tableView: UITableView, didDeselectRowAtIndexPath indexPath: NSIndexPath)
- tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
The tableview has 2 sections (7 and 1 row).
The rows in section 1 are custom cells and should do nothing when selected.
The row in section 2 is a standard UITableViewCell
and should start a download.
But When i selecting any cell tableView(tableView: UITableView, didDeselectRowAtIndexPath indexPath: NSIndexPath)
isn't even called, only after selecting another cell(not the same again), the didSelect will be called with the first cell i selected.
Another example; (x,x) is representing the selected indexPath
(1,0), does nothing -> (0,6), (1,0) is selected -> (0,2), (0,6) is selected -> (1,0), (0,2) is selected
Additions:
- The highlighting is working as it should. Just the call of tableView(tableView: UITableView, didDeselectRowAtIndexPath indexPath: NSIndexPath)
isn't.
- tableView(tableView: UITableView, willSelectRowAtIndexPath indexPath: NSIndexPath) -> NSIndexPath?
is called appropriate.
Solution:
Was a little typo in the delegate method. I implemented didDeselectRowAtIndexPath
instead of didSelectRowAtIndexPath