Swift:Using UIRefreshControl
From Hawk Wiki
Revision as of 04:04, 23 March 2015 by Hall (Talk | contribs) (Created page with "<pre class="brush:swift"> //refreshControl is automatically defined in UITableViewController var refreshControl: UIRefreshControl? override func viewDidLoad() { super.view...")
//refreshControl is automatically defined in UITableViewController var refreshControl: UIRefreshControl? override func viewDidLoad() { super.viewDidLoad() refreshControl = UIRefreshControl() refreshControl?.addTarget(self, action: "fetch", forControlEvents: UIControlEvents.ValueChanged) tableView.insertSubview(refreshControl!, atIndex: 0) } //to stop refresh, call if let rc = self.refreshControl { self.refreshControl!.endRefreshing() }