Skip to content

Instantly share code, notes, and snippets.

@brandonvanha
Created April 5, 2015 20:39
Show Gist options
  • Save brandonvanha/d6bfd603b998705add3b to your computer and use it in GitHub Desktop.
Save brandonvanha/d6bfd603b998705add3b to your computer and use it in GitHub Desktop.
Pull to refresh
class UserTableViewController: UITableViewController {
var refresher: UIRefreshControl!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
refresher = UIRefreshControl()
refresher.attributedTitle = NSAttributedString(string: "Pull to refresh")
refresher.addTarget(self, action: "refresh", forControlEvents: UIControlEvents.ValueChanged)
self.tableView.addSubview(refresher)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment