iOS 13 beta4 no longer gives
1) PHImageFileURLKey 2) PHImageResultIsDegradedKey in image result info keys.
Anyone knows a way to find the fileurl of the PHAsset?
You have to use this function from PHAsset object:
- (PHContentEditingInputRequestID)requestContentEditingInputWithOptions:(nullable PHContentEditingInputRequestOptions *)options completionHandler:(void (^)(PHContentEditingInput *__nullable contentEditingInput, NSDictionary *info))completionHandler;
Then you can retrieve URL this way:
NSURL *url = contentEditingInput.fullSizeImageURL;
Some example Objective-C code for anyone else looking for it:
PHContentEditingInputRequestOptions *editOptions = [[PHContentEditingInputRequestOptions alloc] init];
[myPHAsset requestContentEditingInputWithOptions:editOptions completionHandler:^(PHContentEditingInput *contentEditingInput, NSDictionary *info) {
if (contentEditingInput.fullSizeImageURL) {
//do something with contentEditingInput.fullSizeImageURL
}
}];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With