I have a uiview in my app. I want to show the uiview when uiscrollview Y position changes. I tried some stackoverflow suggestion but can't get the expected result. Here's my code that i tried:
if (topScrollView.contentOffset.y) >= 30{
slideInSearchView.isHidden = false
} else {
slideInSearchView.isHidden = true
}
Make sure code is inside scrollViewDidScroll
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if (topScrollView.contentOffset.y) >= 30{
slideInSearchView.isHidden = false
} else {
slideInSearchView.isHidden = true
}
}