Keaton
Keaton

Reputation: 127

How to make an 'Open In' or 'Share' menu

How do you make an 'Open In' menu? You have seen them before. Photos, Instagram, Email.

Upvotes: 0

Views: 843

Answers (1)

Keaton
Keaton

Reputation: 127

I used to wonder how to make an Apple 'Open In' menu. It is actually really easy!

    NSString* someText = @"Sent from my app!";
UIImage* image = imageview.image;
NSArray* dataToShare = @[someText, image];  //Array of sharable stuff.

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

Thats about it. You dont really need more as it is very simple.

Upvotes: 2

Related Questions