Setting status bars to white as completion of all modal presentations.

pull/1/head
Christine Corbett 10 years ago committed by Frederic Jacobs
parent f5848365f7
commit f0ac231b7f

@ -12,7 +12,6 @@
70377AAB1918450100CAF501 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70377AAA1918450100CAF501 /* MobileCoreServices.framework */; }; 70377AAB1918450100CAF501 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70377AAA1918450100CAF501 /* MobileCoreServices.framework */; };
7038632718F70C0700D4A43F /* CryptoTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632418F70C0700D4A43F /* CryptoTools.m */; }; 7038632718F70C0700D4A43F /* CryptoTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632418F70C0700D4A43F /* CryptoTools.m */; };
7038632818F70C0700D4A43F /* EvpSymetricUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632618F70C0700D4A43F /* EvpSymetricUtil.m */; }; 7038632818F70C0700D4A43F /* EvpSymetricUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632618F70C0700D4A43F /* EvpSymetricUtil.m */; };
707E549218FF26E800C8649D /* SmsInvite.m in Sources */ = {isa = PBXBuildFile; fileRef = 707E549118FF26E800C8649D /* SmsInvite.m */; };
7095B7B018F46D35002C66E2 /* PhoneNumberUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7095B7AF18F46D35002C66E2 /* PhoneNumberUtil.m */; }; 7095B7B018F46D35002C66E2 /* PhoneNumberUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7095B7AF18F46D35002C66E2 /* PhoneNumberUtil.m */; };
70B800A6190C53180042E3F0 /* libspandsp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70B800A3190C529C0042E3F0 /* libspandsp.a */; }; 70B800A6190C53180042E3F0 /* libspandsp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70B800A3190C529C0042E3F0 /* libspandsp.a */; };
70B800AF190C548D0042E3F0 /* libspeex.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70B800AC190C54790042E3F0 /* libspeex.a */; }; 70B800AF190C548D0042E3F0 /* libspeex.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70B800AC190C54790042E3F0 /* libspeex.a */; };
@ -593,8 +592,6 @@
7038632418F70C0700D4A43F /* CryptoTools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CryptoTools.m; sourceTree = "<group>"; }; 7038632418F70C0700D4A43F /* CryptoTools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CryptoTools.m; sourceTree = "<group>"; };
7038632518F70C0700D4A43F /* EvpSymetricUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EvpSymetricUtil.h; sourceTree = "<group>"; }; 7038632518F70C0700D4A43F /* EvpSymetricUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EvpSymetricUtil.h; sourceTree = "<group>"; };
7038632618F70C0700D4A43F /* EvpSymetricUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EvpSymetricUtil.m; sourceTree = "<group>"; }; 7038632618F70C0700D4A43F /* EvpSymetricUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EvpSymetricUtil.m; sourceTree = "<group>"; };
707E549018FF26E800C8649D /* SmsInvite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmsInvite.h; sourceTree = "<group>"; };
707E549118FF26E800C8649D /* SmsInvite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SmsInvite.m; sourceTree = "<group>"; };
7095B7AE18F46D35002C66E2 /* PhoneNumberUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhoneNumberUtil.h; sourceTree = "<group>"; }; 7095B7AE18F46D35002C66E2 /* PhoneNumberUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhoneNumberUtil.h; sourceTree = "<group>"; };
7095B7AF18F46D35002C66E2 /* PhoneNumberUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhoneNumberUtil.m; sourceTree = "<group>"; }; 7095B7AF18F46D35002C66E2 /* PhoneNumberUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhoneNumberUtil.m; sourceTree = "<group>"; };
70B8009E190C529C0042E3F0 /* spandsp.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = spandsp.xcodeproj; path = Libraries/spandsp/spandsp/spandsp.xcodeproj; sourceTree = "<group>"; }; 70B8009E190C529C0042E3F0 /* spandsp.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = spandsp.xcodeproj; path = Libraries/spandsp/spandsp/spandsp.xcodeproj; sourceTree = "<group>"; };
@ -1841,8 +1838,6 @@
7095B7AE18F46D35002C66E2 /* PhoneNumberUtil.h */, 7095B7AE18F46D35002C66E2 /* PhoneNumberUtil.h */,
7095B7AF18F46D35002C66E2 /* PhoneNumberUtil.m */, 7095B7AF18F46D35002C66E2 /* PhoneNumberUtil.m */,
76EB04F018170B33006006FC /* protocols */, 76EB04F018170B33006006FC /* protocols */,
707E549018FF26E800C8649D /* SmsInvite.h */,
707E549118FF26E800C8649D /* SmsInvite.m */,
76EB04F518170B33006006FC /* StringUtil.h */, 76EB04F518170B33006006FC /* StringUtil.h */,
76EB04F618170B33006006FC /* StringUtil.m */, 76EB04F618170B33006006FC /* StringUtil.m */,
76EB04F718170B33006006FC /* ThreadManager.h */, 76EB04F718170B33006006FC /* ThreadManager.h */,
@ -3226,7 +3221,6 @@
E197B61418BBEC1A00F073E5 /* DropoutTracker.m in Sources */, E197B61418BBEC1A00F073E5 /* DropoutTracker.m in Sources */,
76EB062C18170B33006006FC /* OperationFailed.m in Sources */, 76EB062C18170B33006006FC /* OperationFailed.m in Sources */,
FCAC963C19FEF9280046DFC5 /* SignalsViewController.m in Sources */, FCAC963C19FEF9280046DFC5 /* SignalsViewController.m in Sources */,
707E549218FF26E800C8649D /* SmsInvite.m in Sources */,
76EB05DA18170B33006006FC /* LowLatencyConnector.m in Sources */, 76EB05DA18170B33006006FC /* LowLatencyConnector.m in Sources */,
76EB05EE18170B33006006FC /* CallTermination.m in Sources */, 76EB05EE18170B33006006FC /* CallTermination.m in Sources */,
E1CD329618BCFF9900B1A496 /* SoundInstance.m in Sources */, E1CD329618BCFF9900B1A496 /* SoundInstance.m in Sources */,

@ -1,13 +0,0 @@
#import <Foundation/Foundation.h>
#import <MessageUI/MessageUI.h>
#import "PhoneNumber.h"
@interface SmsInvite : NSObject<MFMessageComposeViewControllerDelegate> {
UIViewController* parent;
}
+(SmsInvite*) smsInviteWithParent:(UIViewController*) parent;
-(void)sendSMSInviteToNumber:(PhoneNumber *)number;
@end

@ -1,35 +0,0 @@
#import "SmsInvite.h"
#import "LocalizableText.h"
@implementation SmsInvite
+ (SmsInvite*) smsInviteWithParent:(UIViewController *)parent {
SmsInvite* invite = [SmsInvite new];
invite->parent = parent;
return invite;
}
- (void)sendSMSInviteToNumber:(PhoneNumber *)number{
if (MFMessageComposeViewController.canSendText && [UIDevice.currentDevice.model isEqualToString:@"iPhone"]){
MFMessageComposeViewController *messageController = [MFMessageComposeViewController new];
NSString *inviteMessage = INVITE_USERS_MESSAGE;
messageController.body = [inviteMessage stringByAppendingString:@" https://itunes.apple.com/app/id874139669"];
messageController.recipients = @[number.toE164];
messageController.messageComposeDelegate = self;
[parent presentViewController:messageController
animated:YES
completion:nil];
}
}
- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result {
[controller dismissViewControllerAnimated:YES
completion:nil];
}
@end

@ -6,6 +6,8 @@
#import "UIImage+contentTypes.h" #import "UIImage+contentTypes.h"
#import "MIMETypeUtil.h" #import "MIMETypeUtil.h"
typedef void (^completionBlock)(void);
/** /**
* *
* UIUtil contains various class methods that centralize common app UI functionality that would otherwise be hardcoded. * UIUtil contains various class methods that centralize common app UI functionality that would otherwise be hardcoded.
@ -17,4 +19,6 @@
+ (void)applyRoundedBorderToImageView:(UIImageView *__strong*)imageView; + (void)applyRoundedBorderToImageView:(UIImageView *__strong*)imageView;
+ (void)removeRoundedBorderToImageView:(UIImageView *__strong*)imageView; + (void)removeRoundedBorderToImageView:(UIImageView *__strong*)imageView;
+ (completionBlock)modalCompletionBlock;
@end @end

@ -16,4 +16,12 @@
[[*imageView layer] setCornerRadius:0]; [[*imageView layer] setCornerRadius:0];
} }
+ (completionBlock)modalCompletionBlock {
completionBlock block = ^void() {
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
};
return block;
}
@end @end

@ -152,7 +152,7 @@
[tweetSheet addURL:[NSURL URLWithString:@"https://whispersystems.org/signal/install/"]]; [tweetSheet addURL:[NSURL URLWithString:@"https://whispersystems.org/signal/install/"]];
tweetSheet.completionHandler = ^(SLComposeViewControllerResult result) { tweetSheet.completionHandler = ^(SLComposeViewControllerResult result) {
}; };
[self presentViewController:tweetSheet animated:YES completion:nil]; [self presentViewController:tweetSheet animated:YES completion:[UIUtil modalCompletionBlock]];
} }
} }

@ -9,6 +9,7 @@
#import "FullImageViewController.h" #import "FullImageViewController.h"
#import "DJWActionSheet+OWS.h" #import "DJWActionSheet+OWS.h"
#import "TSAttachmentStream.h" #import "TSAttachmentStream.h"
#import "UIUtil.h"
#define kImageViewCornerRadius 5.0f #define kImageViewCornerRadius 5.0f
@ -210,7 +211,7 @@
self.view.userInteractionEnabled = YES; self.view.userInteractionEnabled = YES;
_isPresenting = NO; _isPresenting = NO;
}]; }];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; [UIUtil modalCompletionBlock]();
}]; }];
} }

@ -20,6 +20,7 @@
#import "ContactTableViewCell.h" #import "ContactTableViewCell.h"
#import "UIColor+OWS.h" #import "UIColor+OWS.h"
#import "UIUtil.h"
@interface MessageComposeTableViewController () <UISearchBarDelegate, UISearchResultsUpdating, MFMessageComposeViewControllerDelegate> @interface MessageComposeTableViewController () <UISearchBarDelegate, UISearchResultsUpdating, MFMessageComposeViewControllerDelegate>
{ {
@ -198,9 +199,7 @@
picker.recipients = [NSArray arrayWithObject:currentSearchTerm]; picker.recipients = [NSArray arrayWithObject:currentSearchTerm];
picker.body = @"I'm inviting you to install Signal! Here is the link: https://itunes.apple.com/us/app/signal-private-messenger/id874139669?mt=8"; picker.body = @"I'm inviting you to install Signal! Here is the link: https://itunes.apple.com/us/app/signal-private-messenger/id874139669?mt=8";
[self presentViewController:picker animated:YES completion:^{ [self presentViewController:picker animated:YES completion:[UIUtil modalCompletionBlock]];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}];
} else { } else {
// TODO: better backup for iPods (just don't support on) // TODO: better backup for iPods (just don't support on)
UIAlertView *notPermitted=[[UIAlertView alloc] initWithTitle:@"Alert" message:@"Your device doesn't support this feature." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; UIAlertView *notPermitted=[[UIAlertView alloc] initWithTitle:@"Alert" message:@"Your device doesn't support this feature." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
@ -214,7 +213,7 @@
sendTextButton.hidden = YES; sendTextButton.hidden = YES;
self.searchController.searchBar.text = @""; self.searchController.searchBar.text = @"";
[self.navigationController dismissViewControllerAnimated:YES completion:nil]; [self.navigationController dismissViewControllerAnimated:YES completion:nil];
[self presentViewController:alertController animated:YES completion:nil]; [self presentViewController:alertController animated:YES completion:[UIUtil modalCompletionBlock]];
} }
#pragma mark - SMS Composer Delegate #pragma mark - SMS Composer Delegate

@ -1019,7 +1019,7 @@ typedef enum : NSUInteger {
if ([UIImagePickerController isSourceTypeAvailable: if ([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypeCamera]) { UIImagePickerControllerSourceTypeCamera]) {
picker.mediaTypes = @[(NSString*)kUTTypeImage,(NSString*)kUTTypeMovie]; picker.mediaTypes = @[(NSString*)kUTTypeImage,(NSString*)kUTTypeMovie];
[self presentViewController:picker animated:YES completion:NULL]; [self presentViewController:picker animated:YES completion:[UIUtil modalCompletionBlock]];
} }
} }
@ -1038,7 +1038,7 @@ typedef enum : NSUInteger {
picker.mediaTypes = (mediaType == kMediaTypePicture) ? pictureTypeArray : videoTypeArray; picker.mediaTypes = (mediaType == kMediaTypePicture) ? pictureTypeArray : videoTypeArray;
[self presentViewController:picker animated:YES completion:nil]; [self presentViewController:picker animated:YES completion:[UIUtil modalCompletionBlock]];
} }
} }

@ -197,7 +197,7 @@ static NSString* const kUnwindToMessagesViewSegue = @"UnwindToMessagesViewSegue"
UIImagePickerControllerSourceTypeCamera]) UIImagePickerControllerSourceTypeCamera])
{ {
picker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *)kUTTypeImage, nil]; picker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *)kUTTypeImage, nil];
[self presentViewController:picker animated:YES completion:NULL]; [self presentViewController:picker animated:YES completion:[UIUtil modalCompletionBlock]];
} }
} }
@ -210,7 +210,7 @@ static NSString* const kUnwindToMessagesViewSegue = @"UnwindToMessagesViewSegue"
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum]) if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum])
{ {
picker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeImage, nil]; picker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeImage, nil];
[self presentViewController:picker animated:YES completion:nil]; [self presentViewController:picker animated:YES completion:[UIUtil modalCompletionBlock]];
} }
} }

@ -112,7 +112,7 @@ static NSString *const kCodeSentSegue = @"codeSent";
- (IBAction)changeCountryCodeTapped { - (IBAction)changeCountryCodeTapped {
CountryCodeViewController *countryCodeController = [CountryCodeViewController new]; CountryCodeViewController *countryCodeController = [CountryCodeViewController new];
[self presentViewController:countryCodeController animated:YES completion:nil]; [self presentViewController:countryCodeController animated:YES completion:[UIUtil modalCompletionBlock]];
} }
- (void)presentInvalidCountryCodeError { - (void)presentInvalidCountryCodeError {

Loading…
Cancel
Save