I have the following piece of code written in swift:
func hai(greeting: String, times: Int) -> String {
return "You are greeted + \(greeting) + \(times) times "
}
hai ("Hello", times: 3)
When I call the function hai
, if I call it the following way hai("hello", 3)
it throws an error and forces me to call the way it was mentioned above.
Can someone please explain why this should be the case? Thanks, I am new to IOS programming.