I'm sharing an image and its description text using UIActivityType
. I need to share the URL of the image if I choose SMS sharing option. How can I do that? Currently I'm sharing the image and data to Facebook and Twitter. How to send the URL in case that SMS option is selected?
Asked
Active
Viewed 183 times
0

zozelfelfo
- 3,776
- 2
- 21
- 35

Naveen George Thoppan
- 551
- 1
- 5
- 27
1 Answers
1
You can share the image using SMS option in the same way that you are doing it with Facebook and Twitter.
The activityType
for SMS is UIActivityTypeMessage
. It is the built-in activityType
.
So the only thing you need to do is provide image and image description as activityItems
while creating your UIActivityController
.
The code snippet is given below:
NSString *imageDescription = @"Image Description Goes Here";
UIImage *image = [UIImage imageNamed:@"Image_Name"];
NSArray *items = [NSArray arrayWithObjects: imageDescription,image,nil];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];
[self presentViewController:activityVC animated:YES completion:nil];

PGDev
- 23,751
- 6
- 34
- 88