Swift Language Basic Use


Example

Functions can be declared without parameters or a return value. The only required information is a name (hello in this case).

func hello()
{
    print("Hello World")
}

Call a function with no parameters by writing its name followed by an empty pair of parenthesis.

hello()
//output: "Hello World"