What is the purpose of the two arrows in the user defined chooseStepFunction() in Swift?

前端 未结 3 543
孤城傲影
孤城傲影 2021-01-12 14:29

What do the double arrows indicate in the return type of the last function here?

Are they used to indicate two different return values?

If so, how do you kno

3条回答
  •  时光说笑
    2021-01-12 15:11

    Notice that it's returning a function. So chooseStepFunction takes a bool and returns a function. The type signature of the function is (Int)->Int.

    An arrow indicates a function with the input parameter on the left side and the output on the right.

提交回复
热议问题