A UIRefreshControl object provides a standard control that can be used to initiate the refreshing of a table view’s contents. You link a refresh control to a table through an associated table view controller object. The table view controller handles the work of adding the control to the table’s visual appearance and managing the display of that control in response to appropriate user gestures.
First declare a property like this in the ViewController
Later in the viewDidLoad() set up the refreshControl as given below:
Now The function refreshTable is defined as:
Set up refreshControl on tableView:
This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0