我已经实现了PHLivePhoto
框架,用于将照片保存为PHAsset
个对象,效果很好。但是,使用UIActivityController
分享livePhoto会引发以下错误:
错误:资源不可用
以下是我的代码:
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: {
})
}
})