Sfoglia il codice sorgente

Add pull to refresh on the object explorers.

Ryan Olson 12 anni fa
parent
commit
4f966278ba

+ 9 - 0
Classes/Object Explorers/FLEXObjectExplorerViewController.m

@@ -93,6 +93,9 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
     self.searchBar.scopeButtonTitles = @[@"No Inheritance", @"Include Inheritance"];
     [self.searchBar sizeToFit];
     self.tableView.tableHeaderView = self.searchBar;
+    
+    self.refreshControl = [[UIRefreshControl alloc] init];
+    [self.refreshControl addTarget:self action:@selector(refreshControlDidRefresh:) forControlEvents:UIControlEventValueChanged];
 }
 
 - (void)viewWillAppear:(BOOL)animated
@@ -114,6 +117,12 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
     [self.searchBar endEditing:YES];
 }
 
+- (void)refreshControlDidRefresh:(id)sender
+{
+    [self updateTableData];
+    [self.refreshControl endRefreshing];
+}
+
 
 #pragma mark - Search