Skip to content

Instantly share code, notes, and snippets.

@victorchee
Created December 24, 2018 01:38
Show Gist options
  • Save victorchee/5ac3f844d4a80f4fa24c07c6e01aa5ec to your computer and use it in GitHub Desktop.
Save victorchee/5ac3f844d4a80f4fa24c07c6e01aa5ec to your computer and use it in GitHub Desktop.
UIView.animate(withDuration: 0.25, animations: {
self.collectionView?.setContentOffset(CGPoint.zero, animated: false)
}) { (finished) in
self.collectionView.refreshControl?.beginRefreshing()
self.collectionView.refreshControl?.sendActions(for: .valueChanged)
self.collectionView.setContentOffset(CGPoint(x: 0, y: -60), animated: false)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment