From d6fd2ff610355e186148f32bcbd19c4c667496c6 Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Thu, 12 Feb 2015 23:52:49 +0100 Subject: [PATCH] Fixes #584 #585 #586 --- .../MessageComposeTableViewController.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Signal/src/view controllers/MessageComposeTableViewController.m b/Signal/src/view controllers/MessageComposeTableViewController.m index 500135a06..93b3f4918 100644 --- a/Signal/src/view controllers/MessageComposeTableViewController.m +++ b/Signal/src/view controllers/MessageComposeTableViewController.m @@ -50,6 +50,8 @@ [self initializeSearch]; self.searchController.searchBar.hidden = NO; + self.searchController.searchBar.backgroundColor = [UIColor whiteColor]; + self.tableView.tableFooterView = [[UIView alloc]initWithFrame:CGRectZero]; [self createLoadingAndBackgroundViews]; } @@ -273,7 +275,7 @@ NSString *formattedNumber = [PhoneNumber tryParsePhoneNumberFromUserSpecifiedText:searchText].toE164; // text to a non-signal number if we have no results and a valid phone # - if (searchResults.count == 0 && searchText.length > 8) { + if (searchResults.count == 0 && searchText.length > 8 && formattedNumber) { NSString *sendTextTo = @"Send SMS to: "; sendTextTo = [sendTextTo stringByAppendingString:formattedNumber]; [sendTextButton setTitle:sendTextTo forState:UIControlStateNormal]; @@ -333,8 +335,10 @@ [alertController addAction:okAction]; sendTextButton.hidden = YES; self.searchController.searchBar.text = @""; - - [self presentViewController:alertController animated:YES completion:[UIUtil modalCompletionBlock]]; + + [self.parentViewController dismissViewControllerAnimated:NO completion:^{ + [self presentViewController:alertController animated:YES completion:[UIUtil modalCompletionBlock]]; + }]; } #pragma mark - SMS Composer Delegate @@ -486,6 +490,4 @@ [self dismissViewControllerAnimated:YES completion:nil]; } - - @end