From 1ca9e0379c5f84cf1fa2af53bb3f4f28ea85b3f6 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Tue, 7 Sep 2021 09:33:18 +0200 Subject: [PATCH] Avoid 'Browse' step when sharing a document in chat. (migration to UIDocumentPickerViewController) --- Classes/ImagePickerView.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Classes/ImagePickerView.m b/Classes/ImagePickerView.m index b65404197..ab1850f74 100644 --- a/Classes/ImagePickerView.m +++ b/Classes/ImagePickerView.m @@ -22,6 +22,8 @@ #import "PhoneMainView.h" #import "SVProgressHUD.h" #import "ShareViewController.h" +#import + @implementation ImagePickerView @@ -392,8 +394,9 @@ static UICompositeViewDescription *compositeDescription = nil; } +(void) pickDocumentForDelegate:(id)documentMenuDelegate { - UIDocumentMenuViewController *documentProviderMenu = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:SUPPORTED_EXTENTIONS inMode:UIDocumentPickerModeImport]; - documentProviderMenu.delegate = documentMenuDelegate; + UIDocumentPickerViewController *documentProviderMenu = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:SUPPORTED_EXTENTIONS inMode:UIDocumentPickerModeImport]; + ChatConversationView *chatView = VIEW(ChatConversationView); + documentProviderMenu.delegate = chatView; if (IPAD) { /* On iPad the activity view controller will be displayed as a popover using the new UIPopoverPresentationController, it requires that you specify an anchor point for the presentation of the popover using one of the three following properties: barButtonItem, sourceView, sourceRect */ ChatConversationView *chatView = VIEW(ChatConversationView);