UITableView in a Today Extension not receiving row taps
Asked Answered
C

3

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?

Chappell answered 10/10, 2014 at 23:18 Comment(3)
Possibly related: #26224037Julissa
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.Styles
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.Pouter
D
2

Workaround: set the opacity to 0.01 like this:

self.view.backgroundColor = [UIColor colorWithWhite:1 alpha:0.01];
Denisdenise answered 11/2, 2015 at 8:38 Comment(1)
i've same issue, but this not worked on xcode 9. any other way to solve this issue?Hellespont
M
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)
Maladminister answered 23/11, 2015 at 10:41 Comment(0)
I
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.

Impressible answered 27/9, 2016 at 8:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.