-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Thanks for the code, you explain better than the original blog :D
With the current implementation, the imageView always pins to the top.
Now we have 2 top constraints from the imageView to the TopLayoutGuide (1 with equal, priority 999 and 1 with less than, priority 1000), let call them C1 and C2
This would make it scroll with the scrollView as well
func scrollViewDidScroll(scrollView: UIScrollView) {
let y = scrollView.contentOffset.y
if y > 0 {
c1.constant = -y
c2.constant = -y
} else {
c1.constant = 0
c2.constant = 0
}
}
Metadata
Metadata
Assignees
Labels
No labels