I am not getting any idea about sharing an animated .gif images using UIActivityViewController.please help me to resolve this.thanks in advance
see this imag
This should do it. Expanding on Jordan Bonitatis' answer. The trick is to create an NSData
object with the contents of the NSURL
.
- (void)share
{
NSURL *imageURL = [NSURL URLWithString:@"http://...url..of..gif];
NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
NSArray *objectsToShare = @[imageData];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:objectsToShare applicationActivities:nil];
NSArray *excludeActivities = @[UIActivityTypeAirDrop,
UIActivityTypePrint,
UIActivityTypePostToVimeo];
activityVC.excludedActivityTypes = excludeActivities;
[self presentViewController:activityVC animated:YES completion:nil];
}