I was able to successfully create a LivePhoto having a jpeg and mov files and also to display it on screen.
Now I'm having trouble for save the LivePhoto to library. With the below code I'm receiving the error: "resource not available".
@IBAction func exportButton(_ sender: Any) {
PHLivePhoto.request(withResourceFileURLs: [imgUrl!,videoUrl!], placeholderImage: previewImg, targetSize: CGSize.zero, contentMode: PHImageContentMode.aspectFit, resultHandler: { (livePhoto,info) -> Void in
let items = [livePhoto] as [Any]
let ac = UIActivityViewController(activityItems: items as [Any], applicationActivities: nil)
self.present(ac, animated: true)
})
}
Thank you in advance!
I was able to export the image correctly using this piece of code: