Hi guys,
I'm hung up on some Swift syntax that I'm not sure why it is the way it is:
I get that it has a ! because the init method returns an optional, but what is the "string: " for? Is it just an explicit parameter name? I was under the impression the first parameter in Swift was not named, only subsequent parameters.
I'm hung up on some Swift syntax that I'm not sure why it is the way it is:
Code:
if let url = NSURL(string: "http://www.google.com")!
I get that it has a ! because the init method returns an optional, but what is the "string: " for? Is it just an explicit parameter name? I was under the impression the first parameter in Swift was not named, only subsequent parameters.