Is it possible to provide a UIDocumentmenteractionController for multiple elements?

The Photos application in iOS 7 allows you to select multiple photos, tap Share and present a document interaction controller with the appropriate settings for several elements.

The Camera application goes further and even updates the parameters of the controller for interacting with documents in real time when you select and deselect photos.

However, the UIDocumentInteractionController class seems to allow only one URL parameter.

Can I do what the Photo and Camera apps do using the open API?

+4
source share
2 answers
- (void)showShareDialog
{
    UIImage *image = [UIImage imageWithCGImage:self.imgView.image.CGImage];

    NSArray* dataToShare = @[image, image2, image3];  // ...or whatever pieces of data you want to share.

    UIActivityViewController* activityViewController =
    [[UIActivityViewController alloc] initWithActivityItems:dataToShare
                                      applicationActivities:nil];
    [self presentViewController:activityViewController animated:YES completion:^{

    }];

}

I think this should help

+6
source

Store URLs of selected items in an array. You can change the displayed actions depending on the number of elements in the array. After the user makes his choice, you can view the URLs and apply the selected action.

0
source

Source: https://habr.com/ru/post/1526338/


All Articles