I’ve began iOS development recently and have created a basic layout using Interface Builder. However, I’ve noticed that my UIScrollView is causing my UITextField and UIButton to be unclickable (up to a certain point).
Here is a screenshot. Everything above the red line is clickable and responds to touch events, but everything below is/does not.

I decided to move my UIScrollView down a few pixels, and noticed this “red line” moved down as well. After shrinking the height of the UIScrollView from 589px to 550px, I am now able to click anywhere on the button/in the text field (since the theoretical “red line” is now just below the button). Here is that screenshot:

So, my question is, why was the UIScrollView doing this to my UITextField and UIButton? It seems as though it was overlapping the text field and button somehow, despite it appearing to be physically below them. Is there any way to avoid this “overlap” without having to sacrifice those 39 pixels I gave up to prevent the “overlap”?
Write this code in
viewDidLoadfunctionHope this helps you..