typealias for empty closures

suggest change
typealias Handler = () -> Void

() and Void are the same return type, so () -> () means the same thing. Either form names a function that takes no parameters and returns nothing. The same name cannot be declared twice.

Here is a usage example. func is a keyword, so the variable needs another name:

var handler: Handler?

handler = {}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents