Skip to content

Instantly share code, notes, and snippets.

@rileybracken
Created February 4, 2015 16:56
Show Gist options
  • Save rileybracken/b55c38a3b94fe949501a to your computer and use it in GitHub Desktop.
Save rileybracken/b55c38a3b94fe949501a to your computer and use it in GitHub Desktop.
func scrollViewDidScroll(scrollView: UIScrollView) {
if scrollView.contentOffset.y <= pointNow {
// Up
UIView.animateWithDuration(
0.0,
delay: 0.0,
options: .CurveEaseOut,
animations: {
self.addToProfileBtn.center.y = 32
},
completion: nil
)
} else if scrollView.contentOffset.y >= pointNow {
// Down
UIView.animateWithDuration(
1.5,
delay: 0.25,
options: .CurveEaseIn,
animations: {
self.addToProfileBtn.center.y -= 64
},
completion: nil
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment