Choosing Label Names

External labels describe the way consumers call your functions, methods, initializers, and (some) subscripts. Each label should be clear. It should express the argument’s purpose with respect to the overall call. In contrast, internal parameter names express the way your implementation assigns semantics. These two may not, in fact, often should not, match.

The following example uses the external label from and the internal parameter name image. The external label supports call sites by introducing the parameter. The internal argument describes the item’s role for its implementation:

 // The vImage_Buffer type is part of the Accelerate network
 // and, as such, does not use Swift style naming
 extension​ vImage_Buffer ...

Get Swift Style now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.