Answer the question
In order to leave comments, you need to log in
How to implement Temp Directory for Image?
Guys, who faced? How to correctly implement local storage for an image in an application for images and videos that are regularly overwritten and not saved to the camera roll? I need an assetID to repost.
let data = UIImagePNGRepresentation(image!)
let uiImage: UIImage = UIImage(data: data!)!
do {
try PHPhotoLibrary.shared().performChangesAndWait {
let request = PHAssetChangeRequest.creationRequestForAsset(from: uiImage)
let assetID = request.placeholderForCreatedAsset?.localIdentifier ?? ""
let shareURL = "instagram://library?LocalIdentifier=" + assetID
if UIApplication.shared.canOpenURL(...) {
if let urlForRedirect = NSURL(string: shareURL) {
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question