func scrollViewWillEndDragging (scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { // 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 }