Because the naming convention for Objective-C (see here) and Swift is to end your method name by the name of your first argument:
func greetPersonNamed(name: String, onDay day: String) -> String {
return "Hello \(name), today is \(day)."
}
greetPersonNamed("Anna", onDay: "Tuesday")
If you prefer to write the name of the first argument, you can do it like so:
func greet(name name: String, day: String) -> String { /* ... */ }
greet(name: "Anna", day: "Tuesday")
The first name
refers to the external name, the second one is the one used inside your method.
EDIT
The naming guidelines for Swift 3 have been released (see here) and they differ from the ones used with Objective-C.
The name of the first argument should not be included in the method name. The external name of the first parameter can be omitted if the function intent is clear. Otherwise you should name it.
Let's say you can greet persons and pets. In that case, you should add an external name for the first argument:
func greet(person name: String, day: String)
func greet(pet name: String, day: String)
greet(person: "Anna", day: "Tuesday")
If you can only greet persons, then you can ommit it:
func greet(name: String, day: String)
greet("Anna", day: "Tuesday")