Created
January 17, 2017 12:59
-
-
Save leoiphonedev/ef88b02536557e5f50b5c15cf8c6ae60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIImage *instaImage = [UIImage imageNamed:@"imagetoShare.png"]; | |
NSString* imagePath = [NSString stringWithFormat:@"%@/image.igo",[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, | |
NSUserDomainMask, YES) lastObject]]; | |
[[NSFileManager defaultManager] removeItemAtPath:imagePath error:nil]; | |
[UIImagePNGRepresentation(instaImage) writeToFile:imagePath atomically:YES]; | |
UIDocumentInteractionController *_docController = [UIDocumentInteractionController interactionControllerWithURL: | |
[NSURL fileURLWithPath:imagePath]]; | |
_docController.UTI = @"com.instagram.exclusivegram"; | |
[_docController presentOpenInMenuFromRect:self.view.frame inView:self.view animated:YES]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment