简体   繁体   English

将录制的视频保存到照片库-无法将类型“ URL”的值转换为预期的参数类型“字符串”

[英]Saving recorded video to photo library - Cannot convert value of type 'URL' to expected argument type 'String'

Hope you are well. 希望你很好。

I am using your SwiftyCam and its very handy to create any simple camera app. 我正在使用您的SwiftyCam及其非常方便地创建任何简单的相机应用程序。 The only problem I am having is I can not find any way to save the recorded video to gallery. 我唯一的问题是我找不到将录制的视频保存到图库的任何方法。

I tried this: UISaveVideoAtPathToSavedPhotosAlbum(url, nil, nil, nil) 我试过这个: UISaveVideoAtPathToSavedPhotosAlbum(url,nil,nil,nil)

But its giving me this error: Cannot convert value of type 'URL' to expected argument type 'String' 但是它给了我这个错误: 无法将类型“ URL”的值转换为预期的参数类型“字符串”

Can you suggest any solution? 您能提出任何解决方案吗?

According to signature 根据签名

func UISaveVideoAtPathToSavedPhotosAlbum(_ videoPath: String, _ completionTarget: Any?, _ completionSelector: Selector?, _ contextInfo: UnsafeMutableRawPointer?) func UISaveVideoAtPathToSavedPhotosAlbum(_ videoPath:字符串,_完成目标:任何?,_completeSelector:选择器,_ contextInfo:UnsafeMutableRawPointer?)

You need to supply video path as String type not URL , so you can use url.path 您需要提供视频路径作为String类型而不是URL ,因此您可以使用url.path

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法将类型(“字符串:字符串”)的值转换为预期的参数类型“ URL” - Cannot convert value of type ('string: String)' to expected argument type 'URL' 无法转换'String?'类型的值 预期的参数类型'URL' - Cannot convert value of type 'String?' to expected argument type 'URL' 无法将类型'String?.Type'的值转换为预期的参数类型'String?' - Cannot convert value of type 'String?.Type' to expected argument type 'String?' 无法将类型“ [String:Any]”的值转换为预期的参数类型“ String” - Cannot convert value of type '[String : Any]' to expected argument type 'String' 错误:无法转换类型“URL?”的值到预期的参数类型'URLRequest - Error : Cannot convert value of type 'URL?' to expected argument type 'URLRequest 无法转换'NSString'类型的值? 预期参数类型'String' - Cannot convert value of type 'NSString'? to expected argument type 'String' 无法将“字符串”类型的值转换为预期的参数类型“ NSManagedObject” Swift - Cannot convert value of type 'String' to expected argument type 'NSManagedObject' Swift 无法将类型“()”的值转换为预期的参数类型“字符串” - Cannot convert value of type '()' to expected argument type 'String' 无法转换类型[[String:Any]? 到预期的参数类型“ _?” - Cannot convert value of type '[String:Any]?' to expected argument type '_?' 无法转换'UILabel!'类型的值! 预期参数'type inout String' - cannot convert value of type 'UILabel!' to expected argument 'type inout String'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM