Lets put a completion block in. Who doesn't love a block?
@interface DUTableView : UITableView
- (void) reloadDataWithCompletion:( void (^) (void) )completionBlock;
@end
and...
#import "DUTableView.h"
@implementation DUTableView
- (void) reloadDataWithCompletion:( void (^) (void) )completionBlock {
[super reloadData];
if(completionBlock) {
completionBlock();
}
}
@end
Usage:
[self.tableView reloadDataWithCompletion:^{
//do your stuff here
}];
EDIT:
Note that the above is only half the solution. The number of sections and rows and the row heights are updated synchronously on the main thread, so using the above code, the completion would call back when some of the UI part was done. But the data loading from the datasource is asynchronous - so really this answer isn't quite what @Michal wanted.