简体   繁体   中英

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. 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)

But its giving me this error: Cannot convert value of type 'URL' to expected argument type 'String'

Can you suggest any solution?

According to signature

func UISaveVideoAtPathToSavedPhotosAlbum(_ videoPath: String, _ completionTarget: Any?, _ completionSelector: Selector?, _ contextInfo: UnsafeMutableRawPointer?)

You need to supply video path as String type not URL , so you can use url.path

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM