From 8578390ee99601ba1f951603f6b4f1adde583712 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 31 Mar 2017 13:57:12 -0400 Subject: [PATCH] Clean up blocklist views. // FREEBIE --- .../src/ViewControllers/AddToBlockListViewController.m | 4 +++- Signal/src/ViewControllers/BlockListViewController.m | 5 ----- Signal/src/ViewControllers/CountryCodeViewController.m | 9 +++++++++ Signal/src/ViewControllers/SettingsTableViewController.m | 5 ----- Signal/src/ViewControllers/SignalsViewController.m | 4 ---- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Signal/src/ViewControllers/AddToBlockListViewController.m b/Signal/src/ViewControllers/AddToBlockListViewController.m index 68eeb5408..e9eba235d 100644 --- a/Signal/src/ViewControllers/AddToBlockListViewController.m +++ b/Signal/src/ViewControllers/AddToBlockListViewController.m @@ -143,7 +143,9 @@ NSString * const kAddToBlockListViewControllerCellIdentifier = @"kAddToBlockList // Block Button Row UIView *blockButtonRow = [self createRowWithHeight:60 previousRow:borderRow2]; - // TODO: Eventually + // TODO: Eventually we should make a view factory that will allow us to + // create views with consistent appearance across the app and move + // towards a "design language." _blockButton = [UIButton buttonWithType:UIButtonTypeCustom]; _blockButton.titleLabel.font = [UIFont ows_mediumFontWithSize:16.f]; [_blockButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; diff --git a/Signal/src/ViewControllers/BlockListViewController.m b/Signal/src/ViewControllers/BlockListViewController.m index b406b45bf..5bed23422 100644 --- a/Signal/src/ViewControllers/BlockListViewController.m +++ b/Signal/src/ViewControllers/BlockListViewController.m @@ -67,11 +67,6 @@ typedef NS_ENUM(NSInteger, BlockListViewControllerSection) { { [super viewDidLoad]; [self.navigationController.navigationBar setTranslucent:NO]; - - dispatch_async(dispatch_get_main_queue(), ^{ - AddToBlockListViewController *vc = [[AddToBlockListViewController alloc] init]; - [self.navigationController pushViewController:vc animated:YES]; - }); } #pragma mark - Table view data source diff --git a/Signal/src/ViewControllers/CountryCodeViewController.m b/Signal/src/ViewControllers/CountryCodeViewController.m index 990ba384b..4fa7e2df7 100644 --- a/Signal/src/ViewControllers/CountryCodeViewController.m +++ b/Signal/src/ViewControllers/CountryCodeViewController.m @@ -24,6 +24,11 @@ static NSString *const kUnwindToCountryCodeWasSelectedSegue = @"UnwindToCountryC _countryCodes = [PhoneNumberUtil countryCodesForSearchTerm:nil]; self.title = NSLocalizedString(@"COUNTRYCODE_SELECT_TITLE", @""); self.searchBar.delegate = self; + if (self.shouldDismissWithoutSegue) { + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop + target:self + action:@selector(dismissWasPressed:)]; + } } #pragma mark - UITableViewDelegate @@ -68,6 +73,10 @@ static NSString *const kUnwindToCountryCodeWasSelectedSegue = @"UnwindToCountryC } } +- (void)dismissWasPressed:(id)sender { + [self dismissViewControllerAnimated:YES completion:nil]; +} + - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 44.0f; } diff --git a/Signal/src/ViewControllers/SettingsTableViewController.m b/Signal/src/ViewControllers/SettingsTableViewController.m index 821f95e46..214dcad74 100644 --- a/Signal/src/ViewControllers/SettingsTableViewController.m +++ b/Signal/src/ViewControllers/SettingsTableViewController.m @@ -111,11 +111,6 @@ typedef enum { [self.destroyAccountButton setTitle:NSLocalizedString(@"SETTINGS_DELETE_ACCOUNT_BUTTON", @"") forState:UIControlStateNormal]; - - dispatch_async(dispatch_get_main_queue(), ^{ - BlockListViewController *vc = [[BlockListViewController alloc] init]; - [self.navigationController pushViewController:vc animated:YES]; - }); } - (void)viewWillAppear:(BOOL)animated diff --git a/Signal/src/ViewControllers/SignalsViewController.m b/Signal/src/ViewControllers/SignalsViewController.m index 947ae09a5..927d055b2 100644 --- a/Signal/src/ViewControllers/SignalsViewController.m +++ b/Signal/src/ViewControllers/SignalsViewController.m @@ -137,10 +137,6 @@ NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallS object:nil]; [self updateBarButtonItems]; - - dispatch_async(dispatch_get_main_queue(), ^{ - [self settingsButtonPressed:nil]; - }); } - (void)updateBarButtonItems {