|
|
|
@ -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);
|
|
|
|
|