Search code examples
iosiphoneuitableviewuiscrollviewiqkeyboardmanager

iOS UITableViewController static tableView does not scroll


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.


Solution

  • 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.