我将我的应用程序转换为 swift 3.0 并遇到问题MailComposeController
。当我调用函数时:
`func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?){
controller.dismiss(animated: true, completion: nil)
}`
first of all I have an error with info:
对我来说有什么奇怪的,因为我从MFMailComposeViewControllerDelegate
。当我改变时Error
to NSError
它有效,但我收到一条带有信息的警告,此方法需要是私有的以避免此警告。
当我在 mailComposer 中看到电子邮件并尝试点击Cancel
该控制器不会消失。有什么解决方案如何关闭这个控制器吗?
我遇到了同样的问题,因为我正在导入RealmSwift
,它有自己的Error
struct.
通过指定您想要的错误类型来修复它。在这种情况下,Swift.Error
.
完整代码:
func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Swift.Error?){
controller.dismiss(animated: true, completion: nil)
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)