我正在尝试使用requestAVAsset通过UIActivityController共享视频PHAsset.这适用于Messaging,但不适用于AirDrop,表示为“失败”.
PHCachingImageManager.default().requestAVAsset(forVideo: asset,options: nil,resultHandler: { (givenAsset,audioMix,info) in let videoAsset = givenAsset as! AVURLAsset let videoURL = videoAsset.url DispatchQueue.main.async { let activityViewController = UIActivityViewController( activityItems: [videoURL],applicationActivities: nil) activityViewController.excludedActivityTypes = [UIActivityType.saveToCameraRoll] if let popoverPresentationController = activityViewController.popoverPresentationController { popoverPresentationController.barButtonItem = (sender) } self.present(activityViewController,animated: true,completion: nil) } })
这似乎适当地提出了UIActivityController并且只适用于某些活动:
>消息 – ✔️Works,正确导出视频.
> AirDrop – ✖️Shows“失败”
> DropBox – ✖️提供正确的DropBox View,但说“发生了未知错误”