Swift Language Functions Basic Use

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

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"


Got any Swift Language Question?