如何从字符串Swift 3获取ALAssetURL?

时间:2017-05-12 22:49:47

标签: ios swift alassetslibrary

我将ALAssetURL保存为数组中的字符串。我想将这些字符串作为URL读回。我如何在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)

我需要保存为字符串,因为我将url数组保存在用户默认值中。

1 个答案:

答案 0 :(得分:0)

方法URL(string: <url>)不会这样做吗?