typealias for closures with parameters
This code block creates a type alias named
SuccessHandler, just in the same way
var string = "" creates a variable with the name
Now whenever you use
SuccessHandler, for example:
You are essentilly writing:
typealias for empty closures
This block creates a type alias that works as a Void to Void function (takes in no parameters and returns nothing).
Here is a usage example:
typealias for other types
You can also use a type alias to give a type another name to make it easier to remember, or make your code more elegant.
typealias for Tuples
And this can be used as: