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 P
With the suggestion of guhan0, I made a small change. Indeed, sometimes, there are more than 1 "fileURL:...", so, I take the first when the value start with "file://" which means there is a file url. I think there is a better solution, but for now, it works well:
private func getFileURLFromPHAssetResource(resourceDescription description: String) -> String? {
let regex = try! NSRegularExpression(pattern: "(?<=fileURL: ).*(?=\\s)")
for match in regex.matches(in: description, options: [], range: NSRange(location: 0, length: description.count)).lazy {
let url = String(description[Range(match.range, in: description)!])
if url.starts(with: "file://") { return url }
}
return nil
}