How to set up a sharing button? Xcode

I found the repository on gifthub, which is exactly what I was looking for. Can you help me set up the code for working with one button? I am lacking experience with ios programmin for this. I almost finished creating my first application, but I need help with this.

Thanks in advance

https://github.com/BobDG/BDGShare

+4
source share
1 answer

For a beginner, I suggest this .. It's a lot easier. Just a few lines of code.

- (IBAction)shareButtonPressed:(id)sender {

    NSLog(@"shareButton pressed");
    NSString *texttoshare = @"text to share";
    UIImage *imagetoshare = [UIImage imageNamed:@"beck.png"];
    NSArray *activityItems = @[texttoshare, imagetoshare];
    UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
    activityVC.excludedActivityTypes = @[UIActivityTypeAssignToContact, UIActivityTypePrint, UIActivityTypePostToTwitter, UIActivityTypePostToWeibo];
    [self presentViewController:activityVC animated:TRUE completion:nil];
}
+19
source

All Articles