使用UIActivityViewController分享实时照片

时间:2017-05-29 06:47:39

标签: ios swift uiactivityviewcontroller

我已经实现了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: {
        })

      }

  })

0 个答案:

没有答案