UIScrollView receiving taps but not contentView

| | August 6, 2015

I have a ViewController setup like so:

-View
--scrollView
---contentView (UIView)

All of my content is in the contentView. Most of the content is UITextFields that I added programmatically to fashion a form-like setup. I can touch the text fields when I first enter the View Controller to bring up the keyboard to type on them, however, as soon as I scroll down (so I can see the rest of the textfields on the view) none of them respond to touch, even the ones that I could originally see and interact with when I first entered the view controller. There is, however, one button that I added from the storyboard that will continuously accept touch events even after scrolling, but the textfields I added programmatically will not.

I added log statements in gestureRecognizers to deduce that after I move the page down to see the rest of the textFields, only the scrollView picks up taps, and not the contentView underneath it that holds all of the textfields.

I don’t have the first clue as to where to look for this sort of situation. Any help would be awesome, this is my first app so things are coming along slowly. Thanks so much in advance.

Leave a Reply