On iOS11 doc picker requires system appearance.
Otherwise nav items are illegible. // FREEBIE
This commit is contained in:
parent
f8182cd3c2
commit
bfaa7f2e0c
|
@ -653,7 +653,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|||
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
// In case we're dismissing a CNContactViewController which requires default system appearance
|
||||
// In case we're dismissing a CNContactViewController, or DocumentPicker which requires default system appearance
|
||||
[UIUtil applySignalAppearence];
|
||||
|
||||
[self addVisibleListeners];
|
||||
|
@ -3073,7 +3073,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|||
|
||||
#pragma mark - Attachment Picking: Documents
|
||||
|
||||
- (void)showAttachmentDocumentPicker
|
||||
- (void)showAttachmentDocumentPickerMenu
|
||||
{
|
||||
NSString *allItems = (__bridge NSString *)kUTTypeItem;
|
||||
NSArray<NSString *> *documentTypes = @[ allItems ];
|
||||
|
@ -3083,6 +3083,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|||
UIDocumentMenuViewController *menuController =
|
||||
[[UIDocumentMenuViewController alloc] initWithDocumentTypes:documentTypes inMode:pickerMode];
|
||||
menuController.delegate = self;
|
||||
|
||||
[self presentViewController:menuController animated:YES completion:nil];
|
||||
}
|
||||
|
||||
|
@ -3092,6 +3093,10 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|||
didPickDocumentPicker:(UIDocumentPickerViewController *)documentPicker
|
||||
{
|
||||
documentPicker.delegate = self;
|
||||
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(11, 0)) {
|
||||
// post iOS11, document picker has no blue header.
|
||||
[UIUtil applyDefaultSystemAppearence];
|
||||
}
|
||||
[self presentViewController:documentPicker animated:YES completion:nil];
|
||||
}
|
||||
|
||||
|
@ -3102,6 +3107,11 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|||
DDLogDebug(@"%@ Picked document at url: %@", self.tag, url);
|
||||
NSData *attachmentData = [NSData dataWithContentsOfURL:url];
|
||||
|
||||
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(11, 0)) {
|
||||
// post iOS11, document picker has no blue header.
|
||||
[UIUtil applySignalAppearence];
|
||||
}
|
||||
|
||||
NSString *type;
|
||||
NSError *typeError;
|
||||
[url getResourceValue:&type forKey:NSURLTypeIdentifierKey error:&typeError];
|
||||
|
@ -3914,7 +3924,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|||
@"action sheet button title when choosing attachment type")
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *_Nonnull action) {
|
||||
[self showAttachmentDocumentPicker];
|
||||
[self showAttachmentDocumentPickerMenu];
|
||||
}];
|
||||
UIImage *chooseDocumentImage = [UIImage imageNamed:@"actionsheet_document_black"];
|
||||
OWSAssert(chooseDocumentImage);
|
||||
|
|
|
@ -80,7 +80,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
} else if ([phoneNumberField.label isEqualToString:CNLabelPhoneNumberiPhone]) {
|
||||
phoneNumberNameMap[phoneNumber.stringValue]
|
||||
= NSLocalizedString(@"PHONE_NUMBER_TYPE_IPHONE", @"Label for 'IPhone' phone numbers.");
|
||||
;
|
||||
} else if ([phoneNumberField.label isEqualToString:CNLabelPhoneNumberMobile]) {
|
||||
phoneNumberNameMap[phoneNumber.stringValue]
|
||||
= NSLocalizedString(@"PHONE_NUMBER_TYPE_MOBILE", @"Label for 'Mobile' phone numbers.");
|
||||
|
|
Loading…
Reference in New Issue