Last active
September 24, 2022 19:48
-
-
Save Anik0808/40727a2fa04efb2348f7606f778f1991 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func scrollViewDidScroll(_ scrollView: UIScrollView) { | |
// get the content offset for y-axis | |
let contentOffsetheight = scrollView.contentOffset.y | |
//if the value is negative | |
if contentOffsetheight < 0 { | |
//change the anchors | |
contentViewTopAnchor.constant = contentOffsetheight | |
headerViewHeightAnchor.constant = 450 + (-contentOffsetheight) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment