I was following a Swift tutorial, and in a function it is declared as:
func clamp (min: CGFloat, max: CGFloat, value: CGFloat) -> CGFloat{}
what does -> mean?
That is called the return arrow and indicates that the function returns a value, whose type follows the ->
. It is optional (along with the type that follows it) if the function returns no value.
More info at Defining and Calling Functions