I have a basic question about swift function calling syntax. I have read documentation but not able to figure it out. So decided to put a query over here.
A piece of code i wrote
var string1 = NSString().stringByAppendingString("First string")
var string2 = NSString.stringByAppendingString("Second string")
println(string1)
println(string2)
Both string have same function calling but return type is different. And only difference here is (). I got out put like
First string
(Function)
Question is why its not giving a warning/error. Is it that var string2 holds method body of stringByAppendingString? Whats going on, New swift developer like me can easily make a this type of typo mistake and not able to figure out.
Can you please explain why its not return value?