Skip to content

Instantly share code, notes, and snippets.

@alobanov
Last active December 29, 2015 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alobanov/7615579 to your computer and use it in GitHub Desktop.
Save alobanov/7615579 to your computer and use it in GitHub Desktop.
Save image to Camera Roll
UIImageWriteToSavedPhotosAlbum(_currentVC.imageView.image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error
contextInfo:(void *)contextInfo
{
// Was there an error?
if (error != NULL)
{
UIAlertView *alert = [[UIAlertView alloc] init];
[alert setTitle: @"Error, try again"];
[alert addButtonWithTitle: @"Next"];
[alert show];
return;
// Show error message...
}
else // No errors
{
UIAlertView *alert = [[UIAlertView alloc] init];
[alert setTitle: @"Image saved"];
[alert addButtonWithTitle: @"Next"];
[alert show];
return;
// Show message image successfully saved
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment