Forked from anonymous/scrollViewWillEndDragging.swift
Created
December 14, 2016 16:00
-
-
Save Ezimetjan/478b3ad61b2bf44545c76732f1df44a6 to your computer and use it in GitHub Desktop.
iOS: Example of how to use UIScrollViewDelegate's scrollViewWillEndDecelerating method in Swift
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 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 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's
pointeenow, notmemory