Skip to content

Commit

Permalink
Also show a reload navigation bar button in the network detail view c…
Browse files Browse the repository at this point in the history
…ontroller.
  • Loading branch information
davidmurray committed Aug 22, 2014
1 parent a403607 commit 7980082
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/DMDetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
@interface DMDetailViewController ()

- (void)_managerDidFinishScanning;
- (void)_refreshControlWasPulled;
- (void)_reload;
- (UITableViewCell *)_disconnectCell;
- (UITableViewCell *)_informationCellAtIndexPath:(NSIndexPath *)indexPath;
- (UITableViewCell *)_recordCellAtIndexPath:(NSIndexPath *)indexPath;

@end

Expand Down Expand Up @@ -50,9 +53,13 @@ - (void)viewDidLoad
[self setTitle:[_network SSID]];

UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(_refreshControlWasPulled) forControlEvents:UIControlEventValueChanged];
[refreshControl addTarget:self action:@selector(_reload) forControlEvents:UIControlEventValueChanged];
[self setRefreshControl:refreshControl];
[refreshControl release];

UIBarButtonItem *scanButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(_reload)];
[[self navigationItem] setRightBarButtonItem:scanButton];
[scanButton release];
}

- (void)_managerDidFinishScanning
Expand All @@ -76,7 +83,7 @@ - (void)_managerDidFinishScanning
}
}

- (void)_refreshControlWasPulled
- (void)_reload
{
[[DMNetworksManager sharedInstance] scan];
}
Expand Down

0 comments on commit 7980082

Please sign in to comment.