I have implemented the PHLivePhoto
framework for saving photo's as PHAsset
objects, which works fine. However, sharing livePhoto's using UIActivityController
raises the following error:
Error: resource not available
Below is my code:
PHLivePhoto.request(withResourceFileURLs: [ URL(fileURLWithPath: FilePaths.VidToLive.livePath + "/IMG.MOV"), URL(fileURLWithPath: FilePaths.VidToLive.livePath + "/IMG.JPG")],
placeholderImage: nil,
targetSize: videoSize!,
contentMode: PHImageContentMode.aspectFit,
resultHandler: { (livePhoto, info) -> Void in
if let objLivePhoto = livePhoto {
let objShare = [objLivePhoto]
let activityController = UIActivityViewController.init(activityItems: objShare, applicationActivities: nil)
controller.present(activityController, animated: true, completion: {
})
}
})