fix button's disabled after failed login

* rename method
* invert logic
This commit is contained in:
Stephan Diederich 2013-09-06 19:27:48 +02:00
parent 567b0def60
commit 0e1b435eb7

View File

@ -217,7 +217,7 @@
} }
- (void)saveAction:(id)sender { - (void)saveAction:(id)sender {
[self showLoginUI:YES]; [self setLoginUIEnabled:NO];
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
[self.delegate authenticationViewController:self [self.delegate authenticationViewController:self
@ -234,14 +234,14 @@
otherButtonTitles:nil]; otherButtonTitles:nil];
[alertView show]; [alertView show];
typeof(self) strongSelf = weakSelf; typeof(self) strongSelf = weakSelf;
[strongSelf showLoginUI:NO]; [strongSelf setLoginUIEnabled:YES];
} }
}]; }];
} }
- (void) showLoginUI:(BOOL) enableLoginUI { - (void) setLoginUIEnabled:(BOOL) enabled {
self.navigationItem.rightBarButtonItem.enabled = !enableLoginUI; self.navigationItem.rightBarButtonItem.enabled = !enabled;
self.tableView.userInteractionEnabled = !enableLoginUI; self.tableView.userInteractionEnabled = !enabled;
} }
@end @end