With the image above, I would like to know/detect if the UIView 3 has reached the top of the UIScrollView.
What I did so far is to get the offSet of the UIView within the UIScrollView then check if it's less than or equal to 0 (zero).
let offsetY = scrollView.convert(myView.frame, to: nil).origin.y
if offsetY <= 0 {
print("myView is at Top")
}
But the code above is surely wrong! anybody who has an idea?
TIA!