Swift Language Functions Function types

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 Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Every function has its own function type, made up of the parameter types and the return type of the function itself. For example the following function:

func sum(x: Int, y: Int) -> (result: Int) { return x + y }

has a function type of:

(Int, Int) -> (Int)

Function types can thus be used as parameters types or as return types for nesting functions.



Got any Swift Language Question?