UITableView.refersh: a method to refresh a tableView in iOS (Swift)
When I was working on building some native iOS UI , UITableView was one of the things that I was working with and at some point during my work, I wanted to refresh the table and I was expecting a built-in method like UITableView.refresh. Naturally, one of the first things that I tried was to type in the variable name in Xcode , key in "." and type "r" expecting the Autocomplete to show the refresh method. However to my surprise there was no refresh method? and I thought what? A basic feature like this should surely be there. Turns out that there is a way to refresh the table, it's just not immediately obvious to someone who's new to iOS. So in this post, I will talk about my solution to refresh table. Problem Refresh UITableView: the tableView in question only has only one section and it should be refreshed with an animation by clicking a button or otherwise. Provide a general, reusable method to refresh UITableView. Solution The solution use...