Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift PhaseSetCreationRequest不工作_Swift_Video_Ios9 - Fatal编程技术网

Swift PhaseSetCreationRequest不工作

Swift PhaseSetCreationRequest不工作,swift,video,ios9,Swift,Video,Ios9,我正在尝试使用PhaseSetCreationRequest将视频文件从我的文档文件夹移动到相机卷。我在苹果的文档或网络上的任何地方都找不到一个很好的例子来说明如何做到这一点。下面的代码失败了,但我不知道为什么。我是否需要以某种方式触发完成块中的请求 我已经验证了电影文件是否存在于我的文档目录中(我已将应用程序资源下载到Mac上,视频工作正常) 谢谢 我的例子对我有用 PHPhotoLibrary.sharedPhotoLibrary().performChanges({ () ->

我正在尝试使用PhaseSetCreationRequest将视频文件从我的文档文件夹移动到相机卷。我在苹果的文档或网络上的任何地方都找不到一个很好的例子来说明如何做到这一点。下面的代码失败了,但我不知道为什么。我是否需要以某种方式触发完成块中的请求

我已经验证了电影文件是否存在于我的文档目录中(我已将应用程序资源下载到Mac上,视频工作正常)


谢谢

我的例子对我有用

    PHPhotoLibrary.sharedPhotoLibrary().performChanges({ () -> Void in
            PHAssetCreationRequest.creationRequestForAssetFromVideoAtFileURL(outputFileURL)
            }, completionHandler: { (success, error) -> Void in
                if success {
                    print("it works!!!")
                    self.removeVideo()
                }
                if error != nil {
                    print(error?.localizedDescription)
    PHPhotoLibrary.sharedPhotoLibrary().performChanges({ () -> Void in
            PHAssetCreationRequest.creationRequestForAssetFromVideoAtFileURL(outputFileURL)
            }, completionHandler: { (success, error) -> Void in
                if success {
                    print("it works!!!")
                    self.removeVideo()
                }
                if error != nil {
                    print(error?.localizedDescription)