简体   繁体   English

Swift函数没有被调用?

[英]Swift function not being called?

Alright, so i am making a video only app with AVKit and MobileCoreServices. 好吧,所以我正在使用AVKit和MobileCoreServices制作仅视频的应用程序。 The video part works perfect except for when I click "Use Video", it doesn't save it like it's supposed to. 视频部分工作正常,除了当我单击“使用视频”时,它没有像预期的那样保存它。 Here are all my functions being called upon: 这是我需要调用的所有函数:

This function isn't being called correctly for some reason but i am receiving no errors or console errors/warnings 由于某些原因未正确调用此函数,但我没有收到任何错误或控制台错误/警告

Here is my extension where i am calling the video function in the UISaveVideoAtPathToSavedPhotosAlbum. 这是我在UISaveVideoAtPathToSavedPhotosAlbum中调用视频功能的扩展程序。 在此处输入图片说明

Here is the button action, where when it is pressed, i am calling the startCameraFromViewController function. 这是按钮动作,在按下该按钮时,我正在调用startCameraFromViewController函数。 在此处输入图片说明

And finally here is the startCameraFromViewController function. 最后是startCameraFromViewController函数。 在此处输入图片说明

It looks like the problem is that your UIImagePickerControllerDelegate method signature doesn't quite match. 看来问题在于您的UIImagePickerControllerDelegate方法签名不完全匹配。 (Probably the example you used was from Swift 2 and has changed for Swift 3). (可能您使用的示例来自Swift 2,并且已更改为Swift 3)。 The proper signature is: 正确的签名是:

optional func imagePickerController(_ picker: UIImagePickerController, 
  didFinishPickingMediaWithInfo info: [String : Any])

Note the underscore before the first argument. 注意第一个参数之前的下划线。

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

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