I am integrating UIDocumentPickerViewController
to show the local storage (File App) for browsing and selecting the PDF. Right now i am selecting a single PDF and previewing it by passing the URL to WKWebview which is working fine. But when i enable allowsMultipleSelection
i am able to select the multiple files and getting multiple URLs
NSArray *types = @[(NSString*)kUTTypePDF];
//Create a object of document picker view and set the mode to Import
UIDocumentPickerViewController *docPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:types inMode:UIDocumentPickerModeImport];
//Set the delegate
docPicker.delegate = self;
docPicker.allowsMultipleSelection = true; // Allows multiple selection.
//present the document picker
[self presentViewController:docPicker animated:YES completion:nil];
The delegate for getting multiple URLs is :
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray <NSURL *>*)urls API_AVAILABLE(ios(11.0));
while previewing using WKWebView i am able to preview only one file as shown below:
But i want to preview both the selected files as WhatsApp does as shown below. Here i can swipe horizontally to preview the selected files
How to preview multiple files similar to WhatsApp? Please help me in this regard.