Is it possible to detect when the user has exhausted through all the feed in their TableViewController?
If so, how?
For example, when you swipe down, all the way to the first post, you should get an error message that says, "You're up to date".
Is it possible to detect when the user has exhausted through all the feed in their TableViewController?
If so, how?
For example, when you swipe down, all the way to the first post, you should get an error message that says, "You're up to date".
You can add refresh control in the tableView and check that the data is updated or not in refresh control method. if no new record found then you show You're up to date.
Ex.
var refreshControl = UIRefreshControl()
override func viewDidLoad() {
super.viewDidLoad()
refreshControl.attributedTitle = NSAttributedString(string: "Pull to refresh")
refreshControl.addTarget(self, action: #selector(refresh(_:)), for: UIControl.Event.valueChanged)
tableView.addSubview(refreshControl) // not required when using UITableViewController
}
@objc func refresh(sender:AnyObject) {
// Code to refresh table view
// Check data is updated or not and the show alert from here
}