Pull to refresh UITableView without UITableViewController

Add a refresh control directly to a UITableView without using a UITableViewController: override func viewDidLoad() { super.viewDidLoad() let refreshControl = UIRefreshControl() refreshControl.addTarget(self, action: #selector(refresh(_:)), for: .valueChanged) if #available(iOS 10.0, *) { tableView.refreshControl = refreshControl } else { tableView.backgroundView = refreshControl } } @objc func refresh(_ refreshControl: UIRefreshControl) { // Do your job, when done: refreshControl.endRefreshing() … Read more

How to implement Android Pull-to-Refresh

Finally, Google released an official version of the pull-to-refresh library! It is called SwipeRefreshLayout, inside the support library, and the documentation is here: Add SwipeRefreshLayout as a parent of view which will be treated as a pull to refresh the layout. (I took ListView as an example, it can be any View like LinearLayout, ScrollView … Read more