Swift – Closure不能有关键字参数错误在Xcode 7.3中

Swift – Closure不能有关键字参数错误在Xcode 7.3中,第1张

概述我已经更新到 Xcode 7.3,我的一些库包括Toast和CNPopupButton给了我这个错误: Closure不能有关键字参数 然后它要求我删除参数Type Name. 这可能是什么问题? 自Swift 2.2(随Xcode 7.3提供)以来,声明如下: button.selectionHandler = { (CNPPopupButton button) -> Void in 应该 bu 我已经更新到 Xcode 7.3,我的一些库包括Toast和CNPopupbutton给了我这个错误:
Closure不能有关键字参数

然后它要求我删除参数Type name.

这可能是什么问题?

自Swift 2.2(随Xcode 7.3提供)以来,声明如下:
button.selectionHandler = { (CNPPopupbutton button) -> VoID in

应该

button.selectionHandler = { (button : CNPPopupbutton) -> VoID in

确实感觉更像是斯威夫特.如果您不想确定类型,也可以使用简写语法:

button.selectionHandler = { button in
总结

以上是内存溢出为你收集整理的Swift – Closure不能有关键字参数错误在Xcode 7.3中全部内容,希望文章能够帮你解决Swift – Closure不能有关键字参数错误在Xcode 7.3中所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1031005.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存