I have this strange issue. To start it all, this is how my view hierarchy looks like:
I have a UIViewController with a UIScrollView with three separate ContainerView's inside it. Each of the ContainerView's frames (and respective UIViewControllers) are set programatically.
I open the second ContainerView with a UIView.animate(...) method. Inside this UIView/UIViewController I have a UITableView. The problem is that only the first five (and half of the sixth for some reason, but maybe that's a clue) UITableViewCell's are selectable. I have about five more UITableViewCell's which is for some reason not selectable.
I don't have any UITapGestureRecognizer's which has been the problem for some other people that I've seen. Also, if I add the TouchesBegan to either the UITableView or the UIViewController holding it, it behaves in the same manner. That will say, it only prints out when I touch the same part of the screen where the UITableViewCell's are selectable.
Is there anyone that have encountered the same issue or something similar to it that can shed some light over this?
Any help, input or thought is very much appreciated.
So I resolved this issue. For anyone else having similar problems this was because the underlying contentView of the
UISrollViewwasn't big enough.Even though the
UITableView, and even the views under it was visible, touches could not reach it since these are somehow registered through theUIScrollViewcontentView (for me, this was anUIViewI added in the Interface Builder on top of theUIScrollView).Also, if you are working with autoLayout, you have to change the contentViews constraints in the Interface Builder since
UIScrollView.contentSizewon't bother to listen to your commands.