【发布时间】:2016-03-11 08:04:01
【问题描述】:
我已经努力将视频剪辑保存到照片库。 这里的代码如下,但它不起作用。 虽然saveVideo返回true,但是我打开相册也拿不到视频片段。
文件路径
是本地文档目录的位置
func saveVideo(filePath: String) {
UISaveVideoAtPathToSavedPhotosAlbum (filePath, self,"video:didFinishSavingWithError:contextInfo:", nil)
}
func video(filePath: String, didFinishSavingWithError error: NSError?, contextInfo:UnsafePointer<Void>) {
if error == nil {
let ac = UIAlertController(title: "Saved!", message: "Your altered video has been saved to your gallery.", preferredStyle: .Alert)
ac.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil))
self.presentViewController(ac, animated: true, completion: nil)
} else {
let ac = UIAlertController(title: "Save error", message: error?.localizedDescription, preferredStyle: .Alert)
ac.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil))
self.presentViewController(ac, animated: true, completion: nil)
}
}
【问题讨论】:
标签: ios save ios9 image-gallery