Share images between My app to Instagram :
NSURL *instagramURL = [NSURL URLWithString:@"instagram://location?id=1"]; if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) { NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"Image.ig"]; NSData *imageData = UIImagePNGRepresentation(originalImageView.image); [imageData writeToFile:savedImagePath atomically:YES]; NSURL *imageUrl = [NSURL fileURLWithPath:savedImagePath]; UIDocumentInteractionController * docController = [[UIDocumentInteractionController alloc] init]; docController.delegate = self; [docController retain]; docController.UTI = @"com.instagram.photo"; [docController setURL:imageUrl]; [docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES]; }
source share