Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 671 Bytes

UITableViewController.md

File metadata and controls

23 lines (16 loc) · 671 Bytes

UITableViewController

Adding a Refresh Control

    override func viewDidLoad() {
        super.viewDidLoad()

        self.refreshControl?.addTarget(self, action: #selector(handleRefresh(refreshControl:)), for: UIControlEvents.valueChanged)
    }

    func handleRefresh(refreshControl: UIRefreshControl) {
        // do some reloading of data and update the table view's data source.
        // fetch more objects from a web service, for example

        self.tableView.reloadData()
        refreshControl.endRefreshing()
    }

Links