简体   繁体   中英

Sharing option with iOS app?

样本图片

i want to share app info on social network with all social networking application that are previously installed in device. i have one demo images just like this, if any idea please give me.

Thanks in advance

Using UIActivityViewController you can Share, apple doc

Example:

UIImage *anImage = [UIImage imageNamed:@"SampleImg.png"];
NSArray *Items   = [NSArray arrayWithObjects:
                         @"your app info", 
                         anImage, nil];

UIActivityViewController *ActivityView = 
        [[UIActivityViewController alloc]
               initWithActivityItems:Items applicationActivities:nil];
[self presentViewController:ActivityView animated:YES completion:nil];

Here's a UI control called REActivityViewController from Roman Efimov that looks like a UIActivity view, but allows for full color icons, total customization, and the control works with iOS 5.0. The control looks and works as expected on iPhone and iPad. This is not simply a control that looks like UIActivityController, but also makes it much easier to create custom activities. Here's an example from the readme showing how easy it is to create a custom activity controller:

    REActivity *customActivity = [[REActivity alloc] initWithTitle:@"Custom"
                                                                     image:[UIImage 
            imageNamed:@"REActivityViewController.bundle/Icon_Custom"]
        actionBlock:^(REActivity *activity, REActivityViewController *activityViewController){
        {
        [activityViewController dismissViewControllerAnimated:YES completion:^{NSLog(@"Hey, there!");}
        ];
        }];

Try this.Happy coding.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM