func chooseStepFunction (backwards:Bool)->(Int)->Int{
return backwards ? a :b
}
我想请问下这里的(Int)->Int 具体是什么意思,小白刚开始学swift不懂
func chooseStepFunction (backwards:Bool)->(Int)->Int{
return backwards ? a :b
}
我想请问下这里的(Int)->Int 具体是什么意思,小白刚开始学swift不懂
参数为Int,返回值为Int的函数,
按照你上面所写, a和b 分别代表一个参数为Int,返回值也为Int的函数