https://www.hackingwithswift.com/swift3
I'm watching some Swift 3 videos and blogs and noticed this new underscore option.
Seems that if you use the underscore in front of a parameter, you don't need to have a named parameter.
@19:30
I don't have Swift 3 yet so I can't test everything.
Q. what happens if you put the underscore under each parameter?
Does this make it so you can have no parameter names on all of the parameters or is it just the 1st parameter?
I'm watching some Swift 3 videos and blogs and noticed this new underscore option.
Seems that if you use the underscore in front of a parameter, you don't need to have a named parameter.
Code:
func sendMessage(_ message: String, to recipient: String, shouting: Bool) {
var message = "\(message), \(recipient):"
if shouting {
message = message.uppercaseString
}
print(message)
}
sendMessage("see you at the Bash", to: "Morgan", shouting: false)
@19:30
I don't have Swift 3 yet so I can't test everything.
Q. what happens if you put the underscore under each parameter?
Does this make it so you can have no parameter names on all of the parameters or is it just the 1st parameter?