We always use local parameter names (node and anchor) in SceneKit methods like:
optional func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor)
In which case the global argument names didAdd and for can be used?
This pattern follows the Swift API Design Guidelines:
More words may be needed to clarify intent or disambiguate meaning, but those that are redundant with information the reader already possesses should be omitted. In particular, omit words that merely repeat type information.
While the Objective-C API is:
- (void)renderer:(id<SCNSceneRenderer>)renderer
didAddNode:(SCNNode *)node
forAnchor:(ARAnchor *)anchor;
It is translated into Swift as:
optional func renderer(_ renderer: SCNSceneRenderer,
didAdd node: SCNNode,
for anchor: ARAnchor)
Presumably the caller knows the types of the arguments so the type information was omitted.
This is also the way Objective-C methods are automatically translated into Swift; see Name Translation from C to Swift and Omit-needless-words.