You can use the table view's new refreshControl property to set your UIRefreshControl.
(Xcode 8, Swift 3.0)
override func viewDidLoad() { super.viewDidLoad() tableView.delegate = self tableView.dataSource = self refreshControl.addTarget(self, action: #selector(ViewController.refreshData), for: UIControlEvents.valueChanged) if #available(iOS 10.0, *) { tableView.refreshControl = refreshControl } else { tableView.addSubview(refreshControl) } } func refreshData() { // Refresh data code tableView.reloadData() refreshControl.endRefreshing() }
(Xcode 8, Swift 3.0)