typealias for closures with parameters

suggest change
typealias SuccessHandler = (NSURLSessionDataTask, AnyObject?) -> Void

This code block creates a type alias named SuccessHandler, just in the same way var string = "" creates a variable with the name string.

Now whenever you use SuccessHandler, for example:

func example(_ handler: SuccessHandler) {}

You are essentilly writing:

func example(_ handler: (NSURLSessionDataTask, AnyObject?) -> Void) {}

Feedback about page:

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



Table Of Contents