typealias for closures with parameters

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

NSURLSessionDataTask is the Swift 2 name. Swift 3 and later call the class URLSessionDataTask.

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

Now whenever you use SuccessHandler, for example:

func example(_ handler: SuccessHandler) {}

You are essentially 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