Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Pull to refresh
// first enable "Refreshing" on controller via storyboard
override func viewDidLoad() {
super.viewDidLoad()
// the value for "action" must mach the function's name
refreshControl?.addTarget(self, action: "reloadStuff", forControlEvents: UIControlEvents.ValueChanged)
}
func reloadStuff() {
// reload data here
// then stop pull to refresh animation
self.refreshControl?.endRefreshing()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment