6

I have a iOS 8 app with a Today Extension. The extension has a UITableView in it and it is rendering correctly. However, didSelectRowAtIndexPath doesn't seem to get called reliably. I am guessing this is because Notification Center is a UIScrollView and embedding a UITableView in those causes some issues, but I am not sure.

Does anyone know what might be causing this issue?

lehn0058
  • 19,977
  • 15
  • 69
  • 109
  • Possibly related: http://stackoverflow.com/questions/26223537/ios-today-extension-table-view-rows-only-detects-taps-on-a-label – Jesse Rusak Nov 12 '14 at 16:51
  • i think the workaround mentioned as "possibly related" above and the answers below is not quite the answer to this question; i've tried the solutions mentioned, and for the problem that those answers are trying to solve, stretching the Label to cover the entire contentView works for me. however, i also have the problem of, after scrolling the entire Today page, tapping on a tableView row doesn't work the first time, but does every time thereafter. i think the guess that it's an anomaly of the tableView being embedded in the scrolling today extension page is correct. haven't yet solved it. – john.k.doe Dec 30 '15 at 22:52
  • I have the same issue after scrolling. It does not work even if you have 100% solid colours. I am sure this is Apple's bug. – Alexey Ishkov May 05 '16 at 07:47

3 Answers3

2

Workaround: set the opacity to 0.01 like this:

self.view.backgroundColor = [UIColor colorWithWhite:1 alpha:0.01];
Undo
  • 25,519
  • 37
  • 106
  • 129
Rahul Thiru
  • 70
  • 1
  • 11
1

This worked for me in Swift 2.1 / iOS 9.1:

self.view.backgroundColor = UIColor(red: (255.0/255.0), green: (255.0/255.0), blue: (255.0/255.0), alpha: 0.01)
user3452015
  • 33
  • 11
0

I had a UITableView in an extension. The height of the extension's view was determined by a height constraint. The cells reacted to taps only sporadically.

What solved this problem was setting preferredContentSize instead of using a constraint.

orkoden
  • 18,946
  • 4
  • 59
  • 50