Explorar el Código

Improve network history table view performance when lots of network activity is occurring.

This was showing up hot in the profile. The documentation for -[UITableView reloadRowsAtIndexPaths:withRowAnimation:] actually suggests what we’re doing here now for cases where you don’t need to make updates obvious to the user.
Ryan Olson hace 11 años
padre
commit
6f2d811338
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      Classes/Network/FLEXNetworkHistoryTableViewController.m

+ 4 - 4
Classes/Network/FLEXNetworkHistoryTableViewController.m

@@ -229,10 +229,10 @@
     for (UITableView *tableView in tableViews) {
         for (FLEXNetworkTransactionTableViewCell *cell in [tableView visibleCells]) {
             if ([cell.transaction isEqual:transaction]) {
-                NSIndexPath *indexPath = [tableView indexPathForCell:cell];
-                if (indexPath) {
-                    [tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
-                }
+                // Using -[UITableView reloadRowsAtIndexPaths:withRowAnimation:] is overkill here and kicks off a lot of
+                // work that can make the table view somewhat unresponseive when lots of updates are streaming in.
+                // We just need to tell the cell that it needs to re-layout.
+                [cell setNeedsLayout];
                 break;
             }
         }