Swift

Function parameters need labels when called unless specified with an underscore.

func myFunc(_ name: Int) // call it like myFunc(3)

Here's a sample of how parameter naming works.

func sayHelloTo(name:String)
{
    print("Hello oh \(name)")
}
 
sayHelloTo(name:"Paul Sammut")
  • swift.txt
  • Last modified: 2020/08/02 19:02
  • by paul