1

I have an Xcode 8 project and whenever I instantiate a UITableViewController, I simply cannot scroll the content. I have made sure that:

  • userInteractionEnabled is set to TRUE (on the tableView)
  • scrollEnabled is set to TRUE (on the tableView)
  • there are no overlayed views which have either userInteractionEnabled set to TRUE or a UITapGestureRecognizer with cancelsTouchesInView set to TRUE
  • there are no small views which have clipsToBounds set to FALSE and may block the scroll
  • the table view height is not bigger that the content's
  • the bouncing + vertical bouncing is set to TRUE
  • I'm using IQKeyboardManager. I have made sure that this bug is not caused by the library, by purposely disabling it.
  • this is not related to orientation either. I have tried with Portrait-only and I have constantly changed the orientation to check the results.

It's interesting that if I tap a UITextField from one of the static cells, the IQKeyboardManager scrolls the content a little bit down. So the table view is scrollable, but I cannot do it by normal swiping.

Furthermore, I thought that this may be related to my specific class, maybe I'm doing something wrong... BUT I've even tried to instantiate a blank UITableViewController at the first initialisation point of the app with 5 sections, but it didn't work.

Please, keep all of this information in mind, what can I do? I'm using iOS 10 and iPhone 6s.

Tamás Sengel
  • 55,884
  • 29
  • 169
  • 223
Paul Razvan Berg
  • 16,949
  • 9
  • 76
  • 114

2 Answers2

1

If I am interpreting your question correctly, make sure that bounces and bounce vertically are turned on. Bouncing causes your table view to not just scroll on overflow. But whenever.

Near the Bottom is the Bounce/bounces option.

joshLor
  • 1,034
  • 1
  • 12
  • 27
  • Unfortunately, I forgot to mention I checked this too :( – Paul Razvan Berg Feb 19 '17 at 17:24
  • Can you post your table views properties in an image. – joshLor Feb 19 '17 at 17:28
  • what about your code?(using your exact properties scrolling works for me) – joshLor Feb 19 '17 at 20:26
  • It's not about the code. I disabled all the code from 'viewDidLoad', 'viewWillAppear' etc. The same result. Heck, I even created an empty UITableViewController, with no class attached to it, set it as the root view controller of the app, it's not swiping! I believe it's a global problem inside the project.. – Paul Razvan Berg Feb 19 '17 at 20:27
  • try creating a new project. Also see if this is helpful http://stackoverflow.com/questions/13793505/uitableviewcontroller-tableview-wont-scroll?rq=1 – joshLor Feb 19 '17 at 20:49
  • That link wasn't helpful :( And I have tried to create a new project, it works on the new one. Apparently, all the static UITableViews are stuck like this in my app. I've been trying to find the cause, maybe it's a nasty extension I thought, but I was not lucky. – Paul Razvan Berg Feb 21 '17 at 19:25
0

Finally, after more than 3 days of daily debugging, I found out the problem ...

This is definitely the trickiest bug I've ever encountered, but it seems that Cocoapods power comes with responsibility. I've imported the following library:

https://github.com/shaps80/iMessageStyleReveal

And unfortunately the library itself breaks the table view scroll. When I debugged the actuals views, it was even more hard to notice the added gesture recognizer of the library, as it had a common name and cancelTouchesInView set to FALSE. The actual problem was inside the extension, where the UITableView methods were overriden.

Removed it and everything works again. Phew.

Paul Razvan Berg
  • 16,949
  • 9
  • 76
  • 114