How to split multiple files via UIDocumentInteractionController?

I am trying to share files with Facebook , mail , google driver and whatsapp .

I can share one file through UIDocumentInteractionController as follows:

  NSString *filePath = [NSString stringWithFormat:@"%@/%@", directory, [fileList objectAtIndex:selectedIndexPath.row]] ; url = [NSURL fileURLWithPath: filePath] ; documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:url]; [documentInteractionController setDelegate:self]; documentInteractionController.UTI = @"net.whatsapp.image"; [documentInteractionController presentOptionsMenuFromRect:CGRectZero inView:self.view animated:YES]; 

How to transfer multiple files via UIDocumentInteractionController without using UIActivityViewController ?

If using NSMutableArray and add some url objects. How to set NSMutableArray to UIDocumentInteractionController ?

Thanks in advance.

+1
source share
1 answer

To split multiple files, you can use the UIActivityViewController.

 UIImage *image = [UIImage imageWithCGImage:self.imgView.image.CGImage]; NSArray* dataToShare = @[image, image2, image3]; // Any data you want to share. UIActivityViewController* activityViewController = [[UIActivityViewController alloc] initWithActivityItems:dataToShare applicationActivities:nil]; [self presentViewController:activityViewController animated:YES completion:nil]; 

This can help you.

+2
source

All Articles