Last active
August 29, 2015 14:24
-
-
Save jaisonv/a0f123d1200e7c99f305 to your computer and use it in GitHub Desktop.
Pull to refresh
This file contains 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
// 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