I used
`NSURL *urlA = [info valueForKey:@"PHImageFileURLKey"];`
but when i try to save image using URL then URL is nil.
`NSData *pngData =[NSData dataWithContentsOfURL:urlA options:NSDataReadingMapped error:nil];`
You can get the imageURL from PHContentEditingInput:
Swift:
asset.requestContentEditingInput(with: PHContentEditingInputRequestOptions()) { (eidtingInput, info) in
if let input = eidtingInput, let imgURL = input.fullSizeImageURL {
// imgURL
}
}
Objective-C:
[asset requestContentEditingInputWithOptions:[PHContentEditingInputRequestOptions new] completionHandler:^(PHContentEditingInput *contentEditingInput, NSDictionary *info) {
NSURL *imageURL = contentEditingInput.fullSizeImageURL;
}];