Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Ezimetjan/478b3ad61b2bf44545c76732f1df44a6 to your computer and use it in GitHub Desktop.
Save Ezimetjan/478b3ad61b2bf44545c76732f1df44a6 to your computer and use it in GitHub Desktop.
iOS: Example of how to use UIScrollViewDelegate's scrollViewWillEndDecelerating method in Swift
func scrollViewWillEndDragging (scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
// how to get value from targetContentOffset:
let y = targetContentOffset.memory.y
// how to set value to targetContentOffset:
targetContentOffset.memory.y = 0 //i.e. amount * value
}
@ThasianX
Copy link

ThasianX commented Jun 7, 2020

It's pointee now, not memory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment