Actually this working is fine in all devices except IPhone-6. Please help me for this problem.
my code is
var refreshControl = UIRefreshControl()
self.refreshControl.addTarget(self, action: #selector(self.refresh(_:)), for: .valueChanged)
self.tableView.addSubview(self.refreshControl)
func refresh(_ sender:AnyObject) {
if self.appDel.isNetworkEnabled
{
DispatchQueue.main.async {
if(self.page < Int(self.total_pages)! )
{
self.page = self.page + 1
self.fetchMessageApiCall()
}
}
}
else
{
self.singletonObj.showAlert("", message: "No Internet")
}
self.refreshControl.endRefreshing()
}
Just allocate refresh controller like this:
hope this helps