cellForRowAtIndexPath
is a named (or external) parameter for the actual indexPath
parameter also known as the internal parameter. The named parameter is what you use when calling the function. Put simply, you have the ability to name a parameter something different than the name of your actual input variable name.
A simplified example
In the following example I've made a simple object with a named parameter of germanShepherd
:
func getDog(barks: Bool, germanShepherd dog: String) {}
Then when I call the function I use:
getDog(true, germanShepherd: myValue)
In my simple example the named parameter can help clear up the ambiguity of the "dog" parameter, just as cellForRowAtIndexPath
helps to clear up the ambiguity of the indexPath
parameter.
Removing the named parameter
You also have the option to remove the named parameter by utilizing an underscore in place of the named parameter like so:
func getDog(barks: Bool, _ dog: String) {}
getDog(true, "yes")
Of course this is all subject to change in Swift 3!