Search code examples
uiscrollviewswift3scrollable

How do you tell if a UIScrollView content overflows


I have a UIScroll view with content in it. If that content overflows, making the scroll view scrollable, I'd like to set the bottom of the view to be a certain color. If it does not, I'd like to set it to a different color.

My issue is, I do not know how to detect if a UIScrollView's content overflows and thus is scrollable.


Solution

  • Check if the scroll view's contentSize is bigger than its bounds.