Gesture Recognizers in iOS · Introduction to simd | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/9225-gesture-recognizers-in-ios/lessons/8

Hello,

As the static func wasn’t given a name, how does it apply to the finalPoint variable with the clamped function ?
Could you please explain the reason ?

Also, first time I see the method as " static func + " What makes it useful here ?

Hey!

You could say that “+” is the “name” of the function. But Swift considers that name to be an operator, so you don’t use it with encapsulating parentheses, like other functions.

We have a video on custom operators here: https://www.raywenderlich.com/1940612-advanced-swift-types-and-operations/lessons/6

1 Like