Swift Default Arguments

In this tutorial you will learn about the Swift Default Arguments and its application with practical example.

Swift Function Argument

In Swift, we pass information in function call as its arguments and the function can either returns some value to the point it where it called from or returns nothing.

Swift Default Arguments

In Swift, we can assign default parameter values in a function definition, so when we call that function with no argument passed for a parameter then its default value assigned. When a function is called with argument, then these arguments is used as parameter values in function, but when a function is called or invoked without passing argument for any specific parameters than default parameter values been used as parameters value as per function definition.

Syntax:-

Example :-

Output:-

swift_function_default_arguments

In this tutorial we have learn about the Swift Default Arguments and its application with practical example. I hope you will like this tutorial.