Member-only story

Swift’s Named Parameters

You can have internal and external names. What next?

Steven Curtis
5 min readJan 17, 2020

Naming conventions are extremely important in programming. Further to this, when you use functions you can have internal and external names which should make a programmer’s life easier. That is, if it is possible to understand them — although this short guide should help you out!

Photo by Luca Bravo on Unsplash

Prerequisites:

  • Be able to produce a “Hello, World!” iOS application (guide HERE)
  • Some basic knowledge of functions (guide HERE)
  • Completion handlers are mentioned later on, if you are unfamiliar with these you can skip this section or read the guide! (guide HERE)

Terminology

Argument labels (External names): The name of a variable that is used externally when a function is called

Function: A group of statements that together can perform a function

Function signature: The header for a function, specifying the return type and parameters for a function

Parameter names (Local names): The name of a variable that is used internally within a function

Parameters: A type of variable that is used to pass information into functions

Using local function…

--

--

No responses yet