Search code examples
iosobjective-cuiactivityviewcontroller

Share multiple images with UIActivityViewController


I am trying to share multiple images with UIActivityViewController, but so far, the examples I have found only share 1 image at a time. Any suggestions?


Solution

  • You should be able to do this using:

    UIImage *image1 = [UIImage imageNamed:@"image1"];
    UIImage *image2 = [UIImage imageNamed:@"image2"];    
    UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[image1, image2] applicationActivities:nil];