How to get ALAssetURL from string Swift 3?

130 views Asked by At

I am saving ALAssetURL as a string inside an array. I would like to read back these strings as URLs. How do I do this in Swift?

assetLib.writeImage(toSavedPhotosAlbum: imageToSave.cgImage, orientation: ALAssetOrientation(rawValue: imageToSave.imageOrientation.rawValue)!, completionBlock: {(url,error) -> Void in
                        // Saving url as string inside urlArray, how do I get url from these strings later?
                        urlArray.append(url?.absoluteString)

I need to save as string because I am saving the url array inside user defaults.

1

There are 1 answers

2
Siddharth Gupta On

Wouldn't the method URL(string: <url>) do the trick?