I would like to set selected row to UITableView in refresh control . I do this because I have update control at the top of my UITableView , and when I load data (and they haven’t actually called it by pulling it), I would like the activity indicator view be visible (this is part of refresh control )
Right now, what I'm doing is setting the refresh control to a “refreshing state” (it has a spinning activity indicator).
[self.refreshControl beginRefreshing]
This works fine, but the only problem is that they do not see it until they pull it out due to the default value in row 1 (index 0), so it is hidden.
Note: There are 0 elements in the UITableView (and always will be).
For example, if I go:
[self.tableView selectRowAtIndexPath:0 animated:YES scrollPosition:UITableViewScrollPositionTop];
It will set the position of the selected item to the first line, but I want it to display the update control, so it’s probably possible:
[self.tableView selectRowAtIndexPath:-1 animated:YES scrollPosition:UITableViewScrollPositionTop];
will work (like 1 index below the first element), but of course it will not be a compiler.
source share