. , , , , UIImagePickerControllerReferenceURL .
, , , UIImagePickerControllerReferenceURL , , UIImagePickerControllerReferenceURL. , .
, - ALAssetLibrary, , URL-.
:
PickerController sourceType, , photosLibrary/savedPhotosAlbum. , writeImageToSavedPhotosAlbum: orientation: completionBlock: URL .
, , , photosLibrary, savedPhotosAlbum, [info objectForKey:UIImagePickerControllerReferenceURL] url
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
[self dismissViewControllerAnimated:YES completion:nil];
if( [picker sourceType] == UIImagePickerControllerSourceTypeCamera )
{
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
ALAssetsLibrary *library = [Utils defaultAssetsLibrary];
[library writeImageToSavedPhotosAlbum:image.CGImage orientation:(ALAssetOrientation)image.imageOrientation completionBlock:^(NSURL *assetURL, NSError *error )
{
}];
}
else
{
}
}
, .