Explorar o código

Update the network history view controller when network debugging is enabled/disabled.

Ryan Olson %!s(int64=11) %!d(string=hai) anos
pai
achega
cae0e0ef98
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      Classes/Network/FLEXNetworkHistoryTableViewController.m

+ 9 - 0
Classes/Network/FLEXNetworkHistoryTableViewController.m

@@ -34,6 +34,7 @@
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNewTransactionRecordedNotification:) name:kFLEXNetworkRecorderNewTransactionNotification object:nil];
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleTransactionUpdatedNotification:) name:kFLEXNetworkRecorderTransactionUpdatedNotification object:nil];
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleTransactionsClearedNotification:) name:kFLEXNetworkRecorderTransactionsClearedNotification object:nil];
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNetworkObserverEnabledStateChangedNotification:) name:kFLEXNetworkObserverEnabledStateChangedNotification object:nil];
         self.title = @"📡  Network";
     }
     return self;
@@ -140,6 +141,8 @@
     return headerText;
 }
 
+#pragma mark - Notification Handlers
+
 - (void)handleNewTransactionRecordedNotification:(NSNotification *)notification
 {
     NSInteger existingRowCount = [self.networkTransactions count];
@@ -198,6 +201,12 @@
     [self updateTransactions];
 }
 
+- (void)handleNetworkObserverEnabledStateChangedNotification:(NSNotification *)notification
+{
+    // Update the header, which displays a warning when network debugging is disabled
+    [self updateFirstSectionHeaderInTableView:self.tableView];
+}
+
 #pragma mark - Table view data source
 
 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView