|
|
@@ -29,6 +29,7 @@
|
|
|
self = [super initWithStyle:style];
|
|
|
if (self) {
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNewTransactionRecordedNotification:) name:kFLEXNetworkRecorderNewTransactionNotification object:nil];
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleTransactionUpdatedNotification:) name:kFLEXNetworkRecorderTransactionUpdatedNotification object:nil];
|
|
|
self.title = @"📡 Network";
|
|
|
}
|
|
|
return self;
|
|
|
@@ -76,6 +77,21 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+- (void)handleTransactionUpdatedNotification:(NSNotification *)notification
|
|
|
+{
|
|
|
+ FLEXNetworkTransaction *transaction = [notification.userInfo objectForKey:kFLEXNetworkRecorderUserInfoTransactionKey];
|
|
|
+ UITableView *activeTableView = self.searchController.isActive ? self.searchController.searchResultsTableView : self.tableView;
|
|
|
+ for (FLEXNetworkTransactionTableViewCell *cell in [activeTableView visibleCells]) {
|
|
|
+ if ([cell.transaction isEqual:transaction]) {
|
|
|
+ NSIndexPath *indexPath = [activeTableView indexPathForCell:cell];
|
|
|
+ if (indexPath) {
|
|
|
+ [activeTableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark - Table view data source
|
|
|
|
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|