【发布时间】:2017-06-11 19:18:11
【问题描述】:
我想在 swift 函数的参数名称之间添加一个空格。我想在swift提供的准备segue功能中实现类似的东西
func prepare(for segue: UIStoryboardSegue, sender: Any?)
实现时在函数调用中使用的“for segue”参数名称。
例如。我想创建一个函数func saveReceipt(for customer:....) 然后我想调用函数saveReceipt(for customer:....)
【问题讨论】:
-
"实现它时在函数调用中使用的“for segue”参数名称" – 不,它被称为
prepare(for: ...)。for是参数标签,在调用处使用,segue是参数名,在方法内部使用。
标签: ios swift function parameters