UITableView - hide all groups / cells during data loading

I do not want to display the table cells until the data is loaded from an external source. I want to show an activity indicator over the background of the table during data loading. I can show the indicator by adding it as a subview in the tableView, but I cannot figure out how to hide the rows until they are ready to display.

All this is handled in the UITableViewController. The table is displayed in a popover.

+3
source share
1 answer

You may have different solutions.
Perhaps the first and faster talking to the uiTableView data source does not have a section. Then, when your external data loads, reload the tableView with sections and rows.

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 

Another solution, hide uiTableView and set the activity indicator to a different view. But you need to avoid the UITableViewController to achieve this ^^

Perhaps the first solution will be faster :-)

+5
source

Source: https://habr.com/ru/post/912193/


All Articles