Search code examples
swift4ios13xcode11phasset

How to get image url from PHAsset for iOS 13


As no longer PHImageFileURLKey is given, how i can get image reference url for picked image!

Using PHImageFileUTIKey key i was able to get the file name.

I tried to play around PHAssetResource.assetResources(for: assets[0]) but still there is no luck!


Solution

  • asset.requestContentEditingInput(with: nil, completionHandler: { (input, info) in
        if let input = input {
            print(input.fullSizeImageURL) // file:///xxx    
        }
    })
    

    this is how i was able to get full imageURL.