Skip to content

Instantly share code, notes, and snippets.

Created July 25, 2015 17:49
Show Gist options
  • Save anonymous/1c9baa594e2bd0d408b1 to your computer and use it in GitHub Desktop.
Save anonymous/1c9baa594e2bd0d408b1 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Jul 25, 2015.
    8 changes: 8 additions & 0 deletions scrollViewWillEndDragging.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    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
    }