
When you’re taking photo inside the app, you might want to save a copy to Photo library.
Here’s how.
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
// Get the image from the result
UIImage* originalImage = [info valueForKey:@"UIImagePickerControllerOriginalImage"];
// Do what you need to do with the image
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) {
// save original image to the library
UIImageWriteToSavedPhotosAlbum (originalImage, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
}
}
- (void) image: (UIImage *) image didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo {
// do what you need to do after saving
}




























Recent Comments