From 036d86bc15db5a98d1a065b00c85fe5b5854f56f Mon Sep 17 00:00:00 2001 From: Stephan Diederich Date: Wed, 11 Sep 2013 15:00:07 +0200 Subject: [PATCH] hide done button when doing UDID style auth --- Classes/BITAuthenticationViewController.m | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Classes/BITAuthenticationViewController.m b/Classes/BITAuthenticationViewController.m index 7cacf9f06c..ccacc2c3b7 100644 --- a/Classes/BITAuthenticationViewController.m +++ b/Classes/BITAuthenticationViewController.m @@ -69,11 +69,7 @@ _statusBarStyle = [[UIApplication sharedApplication] statusBarStyle]; [[UIApplication sharedApplication] setStatusBarStyle:(self.navigationController.navigationBar.barStyle == UIBarStyleDefault) ? UIStatusBarStyleDefault : UIStatusBarStyleBlackOpaque]; - [self updateSkipButton]; - - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone - target:self - action:@selector(saveAction:)]; + [self updateBarButtons]; self.navigationItem.rightBarButtonItem.enabled = [self allRequiredFieldsEntered]; } @@ -88,11 +84,11 @@ - (void)setShowsSkipButton:(BOOL)showsSkipButton { if(_showsSkipButton != showsSkipButton) { _showsSkipButton = showsSkipButton; - [self updateSkipButton]; + [self updateBarButtons]; } } -- (void) updateSkipButton { +- (void) updateBarButtons { if(self.showsSkipButton) { self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:BITHockeyLocalizedString(@"Skip") style:UIBarButtonItemStyleBordered @@ -101,6 +97,13 @@ } else { self.navigationItem.leftBarButtonItem = nil; } + if(self.showsLoginViaWebButton) { + self.navigationItem.rightBarButtonItem = nil; + } else { + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone + target:self + action:@selector(saveAction:)]; + } } - (void)setShowsLoginViaWebButton:(BOOL)showsLoginViaWebButton { @@ -108,6 +111,7 @@ _showsLoginViaWebButton = showsLoginViaWebButton; if(self.isViewLoaded) { [self.tableView reloadData]; + [self updateBarButtons]; [self updateWebLoginButton]; } }